changes how comment.created_at is shown
time_ago_in_words is not cache friendly
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
<% end %>
|
||||
|
||||
• <%= time_ago_in_words(comment.created_at) %>
|
||||
• <%= l comment.created_at.to_datetime, format: :datetime %>
|
||||
</div>
|
||||
|
||||
<% if comment.as_administrator? %>
|
||||
|
||||
@@ -20,3 +20,6 @@
|
||||
# available at http://guides.rubyonrails.org/i18n.html.
|
||||
|
||||
en:
|
||||
time:
|
||||
formats:
|
||||
datetime: "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
@@ -196,4 +196,5 @@ es:
|
||||
default: "%A, %d de %B de %Y %H:%M:%S %z"
|
||||
long: "%d de %B de %Y %H:%M"
|
||||
short: "%d de %b %H:%M"
|
||||
datetime: "%d/%m/%Y %H:%M:%S"
|
||||
pm: pm
|
||||
@@ -14,7 +14,7 @@ feature 'Comments' do
|
||||
comment = Comment.last
|
||||
within first('.comment') do
|
||||
expect(page).to have_content comment.user.name
|
||||
expect(page).to have_content time_ago_in_words(comment.created_at)
|
||||
expect(page).to have_content I18n.l(comment.created_at, format: :datetime)
|
||||
expect(page).to have_content comment.body
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user