Allow create legislation proposals on process draft phase (Merge #3532)

This commit is contained in:
João Lutz
2019-11-12 21:23:59 -03:00
committed by Javier Martín
parent e7842adb67
commit f4ae9725c6
2 changed files with 13 additions and 1 deletions

View File

@@ -16,7 +16,7 @@
</div>
<div class="small-12 medium-3 column">
<% if process.proposals_phase.open? %>
<% if process.proposals_phase.open? || process.draft_phase.open? %>
<p><%= link_to new_legislation_proposal_link_text(process),
new_legislation_process_proposal_path(process),
class: "button expanded",

View File

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