Remove useless answers show view
Until now, in order to edit an answer, we had to click on its title on the table and then on the "Edit answer" link. That was tedious and different from what we usually do in the admin section. Furthermore, the code for the answers table was written twice and when we modified it we forgot to update the one in the `show` action, meaning the table here provided less information than the information present in the answers tables. Co-Authored-By: Javi Martín <javim@elretirao.net>
This commit is contained in:
@@ -33,15 +33,13 @@ describe "Answers", :admin do
|
||||
|
||||
scenario "Update" do
|
||||
question = create(:poll_question)
|
||||
answer = create(:poll_question_answer, question: question, title: "Answer title", given_order: 2)
|
||||
create(:poll_question_answer, question: question, title: "Answer title", given_order: 2)
|
||||
create(:poll_question_answer, question: question, title: "Another title", given_order: 1)
|
||||
|
||||
visit admin_question_answer_path(question, answer)
|
||||
|
||||
click_link "Edit answer"
|
||||
visit admin_question_path(question)
|
||||
within("tr", text: "Answer title") { click_link "Edit" }
|
||||
|
||||
fill_in "Answer", with: "New title"
|
||||
|
||||
click_button "Save"
|
||||
|
||||
expect(page).to have_content "Changes saved"
|
||||
|
||||
Reference in New Issue
Block a user