Refactor proposal poll routes

Moving routes from custom file to the proposal's routes file.
This commit is contained in:
voodoorai2000
2019-04-23 13:20:59 +02:00
committed by decabeza
parent 34834889d8
commit 6f3b213612
3 changed files with 8 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
edit_proposal_dashboard_poll_path(proposal, poll), class: "button hollow" %> edit_proposal_dashboard_poll_path(proposal, poll), class: "button hollow" %>
<% else %> <% else %>
<%= link_to t("dashboard.polls.poll.view_results"), <%= link_to t("dashboard.polls.poll.view_results"),
proposal_poll_results_path(proposal, poll), results_proposal_poll_path(proposal, poll),
class: "button", target: "_blank" %> class: "button", target: "_blank" %>
<% end %> <% end %>
</div> </div>

View File

@@ -23,6 +23,12 @@ resources :proposals do
end end
end end
resources :polls, only: [:show, :results], controller: "polls" do
member do
get :results
end
end
member do member do
post :vote post :vote
post :vote_featured post :vote_featured

View File

@@ -207,7 +207,7 @@ feature "Polls" do
expect(page).to have_content(I18n.l(poll.ends_at.to_date)) expect(page).to have_content(I18n.l(poll.ends_at.to_date))
expect(page).to have_link(poll.title) expect(page).to have_link(poll.title)
expect(page).to have_link(poll.title, href: proposal_poll_path(proposal, poll)) expect(page).to have_link(poll.title, href: proposal_poll_path(proposal, poll))
expect(page).to have_link("View results", href: proposal_poll_results_path(proposal, poll)) expect(page).to have_link("View results", href: results_proposal_poll_path(proposal, poll))
end end
end end
end end