From d13ef77ca518cce8b28bd08a0b5f9b9540884abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 27 Mar 2021 19:02:14 +0100 Subject: [PATCH] Improve legislation process creation test We weren't enabling phases in the test, so anything we did with the dates didn't take any effect. --- spec/system/admin/legislation/processes_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/system/admin/legislation/processes_spec.rb b/spec/system/admin/legislation/processes_spec.rb index 6ef56b1df..27651b28a 100644 --- a/spec/system/admin/legislation/processes_spec.rb +++ b/spec/system/admin/legislation/processes_spec.rb @@ -66,6 +66,7 @@ describe "Admin collaborative legislation", :admin do base_date = Date.current within_fieldset text: "Draft phase" do + check "Enabled" fill_in "Start", with: base_date - 3.days fill_in "End", with: base_date - 1.day end @@ -76,16 +77,21 @@ describe "Admin collaborative legislation", :admin do end within_fieldset "Debate phase" do + check "Enabled" fill_in "Start", with: base_date fill_in "End", with: base_date + 2.days end within_fieldset "Comments phase" do + check "Enabled" fill_in "Start", with: base_date + 3.days fill_in "End", with: base_date + 5.days end + check "legislation_process[draft_publication_enabled]" fill_in "Draft publication date", with: base_date + 3.days + + check "legislation_process[result_publication_enabled]" fill_in "Final result publication date", with: base_date + 7.days click_button "Create process" @@ -99,6 +105,11 @@ describe "Admin collaborative legislation", :admin do expect(page).not_to have_content "Summary of the process" expect(page).to have_content "Describing the process" + within(".legislation-process-list") do + expect(page).to have_link text: "Debate" + expect(page).to have_link text: "Comments" + end + visit legislation_processes_path expect(page).to have_content "An example legislation process"