Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
render tags with empty digests in different rows
Browse files Browse the repository at this point in the history
Signed-off-by: Miquel Sabaté <msabate@suse.com>
  • Loading branch information
mssola committed Apr 18, 2016
1 parent b319360 commit 960e759
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
23 changes: 16 additions & 7 deletions app/views/repositories/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@
th Pushed at
tbody
- @tags.each do |tag|
tr
td
- tag.each do |t|
.label.label-success
= t.name
td= tag.first.author.username
td= tag.first.created_at
- if tag.first.digest.empty?
- tag.each do |t|
tr
td
.label.label-success
= t.name
td= tag.first.author.username
td= tag.first.created_at
- else
tr
td
- tag.each do |t|
.label.label-success
= t.name
td= tag.first.author.username
td= tag.first.created_at

#write_comment_form.collapse
= form_for [@repository, @repository.comments.build], remote: true, html: {id: 'new-comment-form', class: 'form-horizontal', role: 'form'} do |f|
Expand Down
16 changes: 16 additions & 0 deletions spec/features/repositories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,21 @@
expect(find("#star-counter")).to have_content("0")
expect(repo.stars.count).to be 0
end

scenario "Groupped tags are handled properly", js: true do
["", "", "same", "same", "another", "yet-another"].each_with_index do |digest, idx|
create(:tag, name: "tag#{idx}", author: user, repository: repository, digest: digest)
end

expect = [["tag0"], ["tag1"], ["tag2", "tag3"], ["tag4"], ["tag5"]]

visit repository_path(repository)
page.all(".tags tr").each_with_index do |row, idx|
# Skip the header.
next if idx == 0

expect[idx - 1].each { |tag| expect(row.text.include?(tag)).to be_truthy }
end
end
end
end

0 comments on commit 960e759

Please sign in to comment.