After destroy question redirect to his poll show page
After removing a question from a poll it makes more sense to redirect to your own poll show page in order to manage their questions. Currently it is redirecting to the questions index page where all the questions from all the polls are displayed and takes you completely out of the context of the poll you are in. In the future we will remove this index question page.
This commit is contained in:
@@ -48,7 +48,7 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController
|
||||
else
|
||||
notice = t("flash.actions.destroy.error")
|
||||
end
|
||||
redirect_to admin_questions_path, notice: notice
|
||||
redirect_to admin_poll_path(@question.poll), notice: notice
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -147,8 +147,9 @@ describe "Admin poll questions", :admin do
|
||||
end
|
||||
end
|
||||
|
||||
expect(page).not_to have_content(question1.title)
|
||||
expect(page).to have_content(question2.title)
|
||||
expect(page).not_to have_content question1.title
|
||||
expect(page).to have_content question2.title
|
||||
expect(page).to have_current_path admin_poll_path(poll)
|
||||
end
|
||||
|
||||
context "Poll select box" do
|
||||
|
||||
Reference in New Issue
Block a user