From 735eab8e712330a1f920c3f0f24abe81e4f751e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mart=C3=ADn?= Date: Mon, 9 Jul 2018 00:04:12 +0200 Subject: [PATCH] Avoid date changes during residence tests. As it happened with results (commit 4a559ed), these tests failed if `Date.current` changes between the moment records are created and the moment the rest of the test is executed. --- spec/features/officing/residence_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/features/officing/residence_spec.rb b/spec/features/officing/residence_spec.rb index 473a3a979..e5f060366 100644 --- a/spec/features/officing/residence_spec.rb +++ b/spec/features/officing/residence_spec.rb @@ -3,6 +3,14 @@ require 'rails_helper' feature 'Residence' do let(:officer) { create(:poll_officer) } + background do + travel_to Time.now # TODO: use `freeze_time` after migrating to Rails 5. + end + + after do + travel_back + end + feature "Officers without assignments" do scenario "Can not access residence verification" do