Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions app/helpers/time_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,6 @@ def long_time_format(time)
time.strftime("%-d %b %Y, %H:%M")
end

def time_ago_tag(time)
return nil unless time

content_tag(
:time,
"#{time_ago(time)} ago",
datetime: time.rfc3339,
title: long_time_format(time)
)
end

def long_time_tag(time)
return nil unless time

Expand Down
14 changes: 0 additions & 14 deletions test/helpers/time_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ class TimeHelperTest < ActiveSupport::TestCase
end
end

test "#time_ago_tag should return nil for nil input" do
assert_nil time_ago_tag(nil)
end

test "#time_ago_tag should generate HTML time element" do
time = Time.zone.parse("2025-01-15 15:45:30")

travel_to Time.zone.parse("2025-01-15 16:45:30") do
result = time_ago_tag(time)
expected = '<time datetime="2025-01-15T15:45:30Z" title="15 Jan 2025, 15:45">1 hour ago</time>'
assert_equal expected, result
end
end

test "#long_time_tag should return nil for nil input" do
assert_nil long_time_tag(nil)
end
Expand Down