Add consistency to back_links
In some cases (e.g. after editing or creating a resource with errors) the default back_link did not redirect to the expected page. Now we force the back_links to the index pages, so we always get the desired redirect.
This commit is contained in:
@@ -7,6 +7,8 @@ describe "Answers", :admin do
|
||||
visit admin_question_path(question)
|
||||
click_link "Add answer"
|
||||
|
||||
expect(page).to have_link "Go back", href: admin_question_path(question)
|
||||
|
||||
fill_in "Answer", with: "The answer is always 42"
|
||||
fill_in_ckeditor "Description", with: "The Hitchhiker's Guide To The Universe"
|
||||
|
||||
@@ -39,6 +41,8 @@ describe "Answers", :admin do
|
||||
visit admin_question_path(question)
|
||||
within("tr", text: "Answer title") { click_link "Edit" }
|
||||
|
||||
expect(page).to have_link "Go back", href: admin_question_path(question)
|
||||
|
||||
fill_in "Answer", with: "New title"
|
||||
click_button "Save"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user