From a774456b51d1c6a7360e339d5d365ae7ece8c9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 16 Sep 2022 16:50:15 +0200 Subject: [PATCH] Simplify test to edit a poll Instead of having to add `beginning_of_minute` to deal with an issue with Capybara filling datetime fields as mentioned in commit 5a0fde4048, we can travel to the beginning of the minute so we don't have to take the seconds into account. --- spec/system/admin/poll/polls_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/system/admin/poll/polls_spec.rb b/spec/system/admin/poll/polls_spec.rb index 23f023e1f..b9f6df575 100644 --- a/spec/system/admin/poll/polls_spec.rb +++ b/spec/system/admin/poll/polls_spec.rb @@ -75,8 +75,8 @@ describe "Admin polls", :admin do end scenario "Edit" do - travel_to(Time.zone.local(2015, 7, 15, 13, 32, 13)) - poll = create(:poll, :with_image, ends_at: 1.month.from_now.beginning_of_minute) + travel_to(Time.zone.local(2015, 7, 15, 13, 32, 00)) + poll = create(:poll, :with_image, ends_at: 1.month.from_now) visit admin_poll_path(poll) click_link "Edit poll"