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.
This commit is contained in:
Javi Martín
2018-09-02 23:48:02 +02:00
parent c1bb1fb2e1
commit 86aa56b5e8

View File

@@ -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)