From f19662e04dfa9aef2b5b1e801bc926ba58a3c604 Mon Sep 17 00:00:00 2001 From: Ross Chapman Date: Wed, 27 Sep 2023 17:55:14 -0700 Subject: [PATCH] Matches click selectors with html --- .rubocop.yml | 3 --- spec/support/system_helpers.rb | 2 +- spec/system/furniture_spec.rb | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 38ce4995f..3d05101d7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,6 +37,3 @@ Style/TrailingCommaInArrayLiteral: Rails/CreateTableWithTimestamps: Exclude: - db/schema.rb - -Capybara/ClickLinkOrButtonStyle: - EnforcedStyle: link_or_button diff --git a/spec/support/system_helpers.rb b/spec/support/system_helpers.rb index a5dbb3e03..8c3efeaad 100644 --- a/spec/support/system_helpers.rb +++ b/spec/support/system_helpers.rb @@ -2,7 +2,7 @@ module Spec module SystemHelpers def sign_in(user, space) visit(polymorphic_path(space.location)) - click_link_or_button("Sign in") + click_link("Sign in") fill_in("authenticated_session[contact_location]", with: user.email) find('input[type="submit"]').click perform_enqueued_jobs diff --git a/spec/system/furniture_spec.rb b/spec/system/furniture_spec.rb index 466aaffee..4e9a05483 100644 --- a/spec/system/furniture_spec.rb +++ b/spec/system/furniture_spec.rb @@ -16,15 +16,15 @@ def add_gizmo(type, room:) visit(polymorphic_path(room.location(:edit))) select(type, from: "Type of gizmo") - click_link_or_button("Add Gizmo") + click_button("Add Gizmo") end def remove_gizmo(type, room:) visit(polymorphic_path(room.location(:edit))) expect(page).to have_text("Markdown Text Block") within("##{dom_id(room.gizmos.first)}") do - click_link_or_button "Configure Markdown Text Block" + click_link "Configure Markdown Text Block" end - click_link_or_button "Remove Gizmo" + click_link "Remove Gizmo" end end