From 86aa56b5e81f3c5fadc2b0b56c2350a0c78a9b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 2 Sep 2018 23:48:02 +0200 Subject: [PATCH] Fix flaky legislation processes specs They were failing if executed right before midnight. If the process is created right before midnight and then the date changes, when we visit the process path the phase will aready be open. --- spec/features/legislation/processes_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb index 0f233a577..f8bd9f09c 100644 --- a/spec/features/legislation/processes_spec.rb +++ b/spec/features/legislation/processes_spec.rb @@ -144,7 +144,7 @@ feature 'Legislation' do end context 'debate phase' do - scenario 'not open' do + scenario 'not open', :with_frozen_time do process = create(:legislation_process, debate_start_date: Date.current + 1.day, debate_end_date: Date.current + 2.days) visit legislation_process_path(process) @@ -179,7 +179,7 @@ feature 'Legislation' do end context 'draft publication phase' do - scenario 'not open' do + scenario 'not open', :with_frozen_time do process = create(:legislation_process, draft_publication_date: Date.current + 1.day) visit draft_publication_legislation_process_path(process) @@ -199,7 +199,7 @@ feature 'Legislation' do end context 'allegations phase' do - scenario 'not open' do + scenario 'not open', :with_frozen_time do process = create(:legislation_process, allegations_start_date: Date.current + 1.day, allegations_end_date: Date.current + 2.days) visit allegations_legislation_process_path(process) @@ -219,7 +219,7 @@ feature 'Legislation' do end context 'final version publication phase' do - scenario 'not open' do + scenario 'not open', :with_frozen_time do process = create(:legislation_process, result_publication_date: Date.current + 1.day) visit result_publication_legislation_process_path(process)