diff --git a/spec/system/admin/dashboard/actions_spec.rb b/spec/system/admin/dashboard/actions_spec.rb index 71d73415e..4e7a8e78a 100644 --- a/spec/system/admin/dashboard/actions_spec.rb +++ b/spec/system/admin/dashboard/actions_spec.rb @@ -21,7 +21,7 @@ describe "Admin dashboard actions", :admin do expect(page).to have_content("Email") expect(page).to have_content("Poster") - expect(page).to have_selector("a", text: "Edit", count: 3) + expect(page).to have_link "Edit", count: 3 end end diff --git a/spec/system/admin/poll/questions_spec.rb b/spec/system/admin/poll/questions_spec.rb index d71b0fd95..3432f221f 100644 --- a/spec/system/admin/poll/questions_spec.rb +++ b/spec/system/admin/poll/questions_spec.rb @@ -15,30 +15,30 @@ describe "Admin poll questions", :admin do within("#poll_question_#{question1.id}") do expect(page).to have_content(question1.title) - expect(page).to have_content("Edit answers") - expect(page).to have_content("Edit") - expect(page).to have_content("Delete") + expect(page).to have_link "Edit answers" + expect(page).to have_link "Edit" + expect(page).to have_link "Delete" end visit admin_poll_path(poll2) expect(page).to have_content(poll2.name) within("#poll_question_#{question2.id}") do - expect(page).to have_content(question2.title) - expect(page).to have_content("Edit answers") - expect(page).to have_content("Edit") - expect(page).to have_content("Delete") + expect(page).to have_content question2.title + expect(page).to have_link "Edit answers" + expect(page).to have_link "Edit" + expect(page).to have_link "Delete" end visit admin_poll_path(poll3) expect(page).to have_content(poll3.name) within("#poll_question_#{question3.id}") do - expect(page).to have_content(question3.title) - expect(page).to have_link("(See proposal)", href: proposal_path(question3.proposal)) - expect(page).to have_content("Edit answers") - expect(page).to have_content("Edit") - expect(page).to have_content("Delete") + expect(page).to have_content question3.title + expect(page).to have_link "(See proposal)", href: proposal_path(question3.proposal) + expect(page).to have_link "Edit answers" + expect(page).to have_link "Edit" + expect(page).to have_link "Delete" end end