Files
fizzy/test/controllers/events_controller_test.rb
T
Kevin McConnell c75247133e Fix time-dependent test
This test would fail when the two timezones is covers landed on
different days (like in the first few hours of UTC). So let's fix the
test to a particular moment in time.
2025-02-17 15:07:17 +00:00

29 lines
698 B
Ruby

require "test_helper"
class EventsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
events(:layout_assignment_jz).update!(created_at: Time.current.beginning_of_day + 8.hours)
travel_to Time.current.beginning_of_day + 15.hours
end
test "index" do
get events_url
assert_select "div.event__wrapper[style='grid-area: 17/1']" do
assert_select "strong", text: "Layout is broken"
end
end
test "index with a specific timezone" do
cookies[:timezone] = "America/New_York"
get events_url
assert_select "div.event__wrapper[style='grid-area: 22/1']" do
assert_select "strong", text: "Layout is broken"
end
end
end