Refactor proposal poll routes
Moving routes from custom file to the proposal's routes file.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
edit_proposal_dashboard_poll_path(proposal, poll), class: "button hollow" %>
|
||||
<% else %>
|
||||
<%= link_to t("dashboard.polls.poll.view_results"),
|
||||
proposal_poll_results_path(proposal, poll),
|
||||
results_proposal_poll_path(proposal, poll),
|
||||
class: "button", target: "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -23,6 +23,12 @@ resources :proposals do
|
||||
end
|
||||
end
|
||||
|
||||
resources :polls, only: [:show, :results], controller: "polls" do
|
||||
member do
|
||||
get :results
|
||||
end
|
||||
end
|
||||
|
||||
member do
|
||||
post :vote
|
||||
post :vote_featured
|
||||
|
||||
@@ -207,7 +207,7 @@ feature "Polls" do
|
||||
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, 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
|
||||
|
||||
Reference in New Issue
Block a user