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

Commit

Permalink
Fix when either the image_id or the digest are nil
Browse files Browse the repository at this point in the history
There was an exception raised when a tag with either a nil digest or a nil
image_id was to be rendered.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed May 25, 2016
1 parent ac58b05 commit 0b8d1bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/repositories/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
= t.name
td= tag.first.author.username
td
- if tag.first.image_id.empty?
- if tag.first.image_id.blank?
= "-"
- else
span[title="sha256:#{tag.first.image_id}"]
Expand All @@ -70,7 +70,7 @@
= t.name
td= tag.first.author.username
td
- if tag.first.image_id.empty?
- if tag.first.image_id.blank?
= "-"
- else
span[title="sha256:#{tag.first.image_id}"]
Expand Down
7 changes: 7 additions & 0 deletions spec/features/repositories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,12 @@
expectations[idx - 1].each { |tag| expect(row.text.include?(tag)).to be_truthy }
end
end

scenario "it works if both the digest and the image_id are blank", js: true do
create(:tag, author: user, repository: repository, digest: nil, image_id: nil)
create(:tag, author: user, repository: repository, digest: "nonblank", image_id: nil)

visit repository_path(repository)
end
end
end

0 comments on commit 0b8d1bf

Please sign in to comment.