Fix crash in management with successful proposals

The page was crashing because it was looking for the `supports` partial
under `management/proposals`, when the right path was `proposals/`.
This commit is contained in:
Javi Martín
2020-09-22 21:19:32 +02:00
parent 6c0fc33842
commit 3e2d7fd707
2 changed files with 10 additions and 1 deletions

View File

@@ -22,7 +22,7 @@
</div> </div>
<% elsif proposal.successful? %> <% elsif proposal.successful? %>
<div class="supports text-center"> <div class="supports text-center">
<%= render "supports", proposal: proposal %> <%= render "proposals/supports", proposal: proposal %>
</div> </div>
<% elsif proposal.archived? %> <% elsif proposal.archived? %>
<div class="padding text-center"> <div class="padding text-center">

View File

@@ -75,6 +75,15 @@ describe "Proposals" do
expect(page).not_to have_current_path(old_path) expect(page).not_to have_current_path(old_path)
expect(page).to have_current_path(right_path) expect(page).to have_current_path(right_path)
end end
scenario "Successful proposal", :js do
proposal = create(:proposal, :successful, title: "Success!")
login_managed_user(create(:user, :level_two))
visit management_proposal_path(proposal)
expect(page).to have_content("Success!")
end
end end
scenario "Searching" do scenario "Searching" do