Skip to content

Commit

Permalink
add auto_link helper to Item url (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Aug 11, 2021
1 parent 98594f9 commit 37edf7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/items/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

<p>
<strong><%= t('activerecord.attributes.item.url') -%>:</strong>
<%= @item.url -%>
<%= auto_link(@item.url) -%>
</p>

<p>
Expand Down
6 changes: 6 additions & 0 deletions spec/system/items_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,11 @@
visit item_path(@item.id, locale: :ja)
expect(page).not_to have_content @item.price
end

it 'should add a link to url' do
@item.update(url: 'http://example.jp')
visit item_path(@item.id)
expect(page).to have_link 'http://example.jp'
end
end
end

0 comments on commit 37edf7d

Please sign in to comment.