diff --git a/app/views/dashboard/polls/_poll.html.erb b/app/views/dashboard/polls/_poll.html.erb index 8875f4247..99da065f6 100644 --- a/app/views/dashboard/polls/_poll.html.erb +++ b/app/views/dashboard/polls/_poll.html.erb @@ -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 %> diff --git a/config/routes/proposal.rb b/config/routes/proposal.rb index 1c625ffea..55013e868 100644 --- a/config/routes/proposal.rb +++ b/config/routes/proposal.rb @@ -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 diff --git a/spec/features/dashboard/polls_spec.rb b/spec/features/dashboard/polls_spec.rb index beeb6f83d..c3bccc65d 100644 --- a/spec/features/dashboard/polls_spec.rb +++ b/spec/features/dashboard/polls_spec.rb @@ -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