From f4ae9725c65e2b3a9b2436a7ab61384797fbc143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lutz?= Date: Tue, 12 Nov 2019 21:23:59 -0300 Subject: [PATCH] Allow create legislation proposals on process draft phase (Merge #3532) --- .../processes/_proposals_content.html.erb | 2 +- spec/features/legislation/processes_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/legislation/processes/_proposals_content.html.erb b/app/views/legislation/processes/_proposals_content.html.erb index 7ef52b337..b54ef902d 100644 --- a/app/views/legislation/processes/_proposals_content.html.erb +++ b/app/views/legislation/processes/_proposals_content.html.erb @@ -16,7 +16,7 @@
- <% if process.proposals_phase.open? %> + <% if process.proposals_phase.open? || process.draft_phase.open? %>

<%= link_to new_legislation_proposal_link_text(process), new_legislation_process_proposal_path(process), class: "button expanded", diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb index f436263b6..882dbdfe9 100644 --- a/spec/features/legislation/processes_spec.rb +++ b/spec/features/legislation/processes_spec.rb @@ -198,6 +198,18 @@ describe "Legislation" do visit legislation_process_path(process) expect(page).to have_content("Français") end + + scenario "Shows Create a Proposal button when process is in draft phase" do + process = create(:legislation_process, + :in_draft_phase, + proposals_phase_start_date: Date.tomorrow) + + login_as(administrator) + visit legislation_process_proposals_path(process) + click_link "Create a proposal" + + expect(page).to have_current_path new_legislation_process_proposal_path(process) + end end context "homepage" do