diff --git a/spec/components/admin/poll/officers/officers_component_spec.rb b/spec/components/admin/poll/officers/officers_component_spec.rb index 51246a02d..17174385e 100644 --- a/spec/components/admin/poll/officers/officers_component_spec.rb +++ b/spec/components/admin/poll/officers/officers_component_spec.rb @@ -35,6 +35,6 @@ describe Admin::Poll::Officers::OfficersComponent, :admin do it "accepts table options" do render_inline Admin::Poll::Officers::OfficersComponent.new(officers, class: "my-officers-table") - expect(page).to have_css "table.my-officers-table" + expect(page).to have_table class: "my-officers-table" end end diff --git a/spec/system/legislation/draft_versions_spec.rb b/spec/system/legislation/draft_versions_spec.rb index 745494f5d..fac192a47 100644 --- a/spec/system/legislation/draft_versions_spec.rb +++ b/spec/system/legislation/draft_versions_spec.rb @@ -443,7 +443,7 @@ describe "Legislation Draft Versions" do scenario "See table as a user" do visit legislation_process_draft_version_path(draft_version.process, draft_version) - expect(page).to have_css("table") + expect(page).to have_table expect(page).to have_content "Roberta" expect(page).to have_content "25" end @@ -454,7 +454,7 @@ describe "Legislation Draft Versions" do visit path click_link "Launch text editor" - expect(page).to have_css("table") + expect(page).to have_table expect(page).to have_content "Roberta" expect(page).to have_content "25" end diff --git a/spec/system/management/account_spec.rb b/spec/system/management/account_spec.rb index 6e9c08dad..da4f58671 100644 --- a/spec/system/management/account_spec.rb +++ b/spec/system/management/account_spec.rb @@ -80,7 +80,7 @@ describe "Account" do click_button "Save password" expect(page).to have_content "Password reseted successfully" - expect(page).to have_css("a[href='javascript:window.print();']", text: "Print password") + expect(page).to have_link "Print password", href: "javascript:window.print();" expect(page).to have_css("div.for-print-only", text: "another_new_password", visible: :hidden) end diff --git a/spec/system/management/proposals_spec.rb b/spec/system/management/proposals_spec.rb index 421b2a080..e3982f8f4 100644 --- a/spec/system/management/proposals_spec.rb +++ b/spec/system/management/proposals_spec.rb @@ -200,7 +200,7 @@ describe "Proposals" do click_link "Print proposals" expect(page).to have_css(".proposal", count: 5) - expect(page).to have_css("a[href='javascript:window.print();']", text: "Print") + expect(page).to have_link "Print", href: "javascript:window.print();" end scenario "Filtering proposals to be printed" do diff --git a/spec/system/votes_spec.rb b/spec/system/votes_spec.rb index 0cf6488a0..294d91bc7 100644 --- a/spec/system/votes_spec.rb +++ b/spec/system/votes_spec.rb @@ -19,37 +19,37 @@ describe "Votes" do within("#debates") do within("#debate_#{debate1.id}_votes") do within(".in-favor") do - expect(page).to have_css("button.voted") - expect(page).not_to have_css("button.no-voted") + expect(page).to have_button class: "voted" + expect(page).not_to have_button class: "no-voted" end within(".against") do - expect(page).to have_css("button.no-voted") - expect(page).not_to have_css("button.voted") + expect(page).to have_button class: "no-voted" + expect(page).not_to have_button class: "voted" end end within("#debate_#{debate2.id}_votes") do within(".in-favor") do - expect(page).not_to have_css("button.voted") - expect(page).not_to have_css("button.no-voted") + expect(page).not_to have_button class: "voted" + expect(page).not_to have_button class: "no-voted" end within(".against") do - expect(page).not_to have_css("button.no-voted") - expect(page).not_to have_css("button.voted") + expect(page).not_to have_button class: "no-voted" + expect(page).not_to have_button class: "voted" end end within("#debate_#{debate3.id}_votes") do within(".in-favor") do - expect(page).to have_css("button.no-voted") - expect(page).not_to have_css("button.voted") + expect(page).to have_button class: "no-voted" + expect(page).not_to have_button class: "voted" end within(".against") do - expect(page).to have_css("button.voted") - expect(page).not_to have_css("button.no-voted") + expect(page).to have_button class: "voted" + expect(page).not_to have_button class: "no-voted" end end end @@ -63,14 +63,14 @@ describe "Votes" do within(".in-favor") do expect(page).to have_content "0%" - expect(page).not_to have_css("button.voted") - expect(page).not_to have_css("button.no-voted") + expect(page).not_to have_button class: "voted" + expect(page).not_to have_button class: "no-voted" end within(".against") do expect(page).to have_content "0%" - expect(page).not_to have_css("button.voted") - expect(page).not_to have_css("button.no-voted") + expect(page).not_to have_button class: "voted" + expect(page).not_to have_button class: "no-voted" end end @@ -81,19 +81,19 @@ describe "Votes" do within(".in-favor") do expect(page).to have_content "100%" - expect(page).to have_css("button.voted") + expect(page).to have_button class: "voted" end click_button "I disagree" within(".in-favor") do expect(page).to have_content "0%" - expect(page).to have_css("button.no-voted") + expect(page).to have_button class: "no-voted" end within(".against") do expect(page).to have_content "100%" - expect(page).to have_css("button.voted") + expect(page).to have_button class: "voted" end expect(page).to have_content "1 vote" @@ -127,12 +127,12 @@ describe "Votes" do within(".in-favor") do expect(page).to have_content "50%" - expect(page).to have_css("button.voted") + expect(page).to have_button class: "voted" end within(".against") do expect(page).to have_content "50%" - expect(page).to have_css("button.no-voted") + expect(page).to have_button class: "no-voted" end end @@ -143,12 +143,12 @@ describe "Votes" do within(".in-favor") do expect(page).to have_content "100%" - expect(page).to have_css("button.voted") + expect(page).to have_button class: "voted" end within(".against") do expect(page).to have_content "0%" - expect(page).to have_css("button.no-voted") + expect(page).to have_button class: "no-voted" end expect(page).to have_content "1 vote" @@ -163,12 +163,12 @@ describe "Votes" do within(".in-favor") do expect(page).to have_content "100%" - expect(page).to have_css("button.voted") + expect(page).to have_button class: "voted" end within(".against") do expect(page).to have_content "0%" - expect(page).to have_css("button.no-voted") + expect(page).to have_button class: "no-voted" end expect(page).to have_content "1 vote"