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/furniture/marketplace/buying_products_system_spec.rb b/spec/furniture/marketplace/buying_products_system_spec.rb index e90dfabb6..0f55f9e96 100644 --- a/spec/furniture/marketplace/buying_products_system_spec.rb +++ b/spec/furniture/marketplace/buying_products_system_spec.rb @@ -27,13 +27,13 @@ def url_options it "Works for Guests" do # rubocop:disable RSpec/ExampleLength visit(polymorphic_path(marketplace.room.location)) select(marketplace.delivery_areas.first.label, from: "cart[delivery_area_id]") - click_on("Save changes") + click_button("Save changes") add_product_to_cart(marketplace.products.first) expect(page).to have_content("Total: #{humanized_money_with_symbol(marketplace.products.first.price + marketplace.delivery_areas.first.price)}") - click_on("Checkout") + click_link("Checkout") set_delivery_details(delivery_address: "123 N West St Oakland, CA", contact_email: "AhsokaTano@example.com", @@ -62,7 +62,7 @@ def url_options def add_product_to_cart(product) within("##{dom_id(product).gsub("product", "cart_product")}") do - click_on(t("marketplace.cart_product_component.add")) + click_link(t("marketplace.cart_product_component.add")) end end @@ -70,11 +70,11 @@ def set_delivery_details(delivery_address:, contact_phone_number:, contact_email fill_in("Delivery address", with: delivery_address) fill_in("Contact phone number", with: contact_phone_number) fill_in("Contact email", with: contact_email) - click_on("Save changes") + click_button("Save changes") end def pay(card_number:, card_expiry:, card_cvc:, billing_name:, email:, billing_postal_code:) - click_on("Make Payment") + click_button("Make Payment") fill_in("cardNumber", with: card_number) fill_in("cardExpiry", with: card_expiry) fill_in("cardCvc", with: card_cvc) diff --git a/spec/furniture/marketplace/collecting_payments_system_spec.rb b/spec/furniture/marketplace/collecting_payments_system_spec.rb index 6e8cb9e5c..67b096489 100644 --- a/spec/furniture/marketplace/collecting_payments_system_spec.rb +++ b/spec/furniture/marketplace/collecting_payments_system_spec.rb @@ -15,29 +15,29 @@ visit polymorphic_path(marketplace.room.location) within("##{dom_id(marketplace, :onboarding)}") do - click_on("Manage Marketplace") + click_link("Manage Marketplace") end - click_on("Payment Settings") + click_link("Payment Settings") within("#stripe_overview") do - click_on("Add Stripe Account") + click_link("Add Stripe Account") end - click_on("Add a Stripe API key to #{space.name}") - click_on("Add Utility") + click_link("Add a Stripe API key to #{space.name}") + click_link("Add Utility") select("stripe", from: "Type") fill_in("Name", with: "Test Stripe Account") - click_on("Create") - click_on("Edit stripe 'Test Stripe Account'") + click_button("Create") + click_link("Edit stripe 'Test Stripe Account'") fill_in("Api token", with: ENV.fetch("STRIPE_API_KEY", "not-a-real-key")) - click_on("Save changes to Stripe Utility") + click_button("Save changes to Stripe Utility") expect(page).to have_content("Test Stripe Account") expect(space.utilities).to exist(utility_slug: "stripe") expect(space.utilities.find_by(utility_slug: "stripe").utility.api_token).to eq(ENV.fetch("STRIPE_API_KEY", "not-a-real-key")) visit polymorphic_path(marketplace.location(:edit)) - click_on("Payment Settings") - click_on("View Stripe Account") + click_link("Payment Settings") + click_link("View Stripe Account") expect(page).to have_content("Connect to Stripe") end @@ -46,10 +46,10 @@ visit polymorphic_path(marketplace.room.location) within("##{dom_id(marketplace, :onboarding)}") do - click_on("Manage Marketplace") + click_link("Manage Marketplace") end - click_on("Payment Settings") - click_on("View Stripe Account") + click_link("Payment Settings") + click_link("View Stripe Account") expect(page).to have_content("Connect to Stripe") # @todo actually figure out how to do the connect to stripe bit :X end 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 diff --git a/spec/system/sections_spec.rb b/spec/system/sections_spec.rb index e363d7ab1..af0a65d63 100644 --- a/spec/system/sections_spec.rb +++ b/spec/system/sections_spec.rb @@ -22,7 +22,7 @@ context "when the Section has no Gizmos" do it "deletes the Section from the Database" do - click_on(I18n.t("rooms.destroy.link_to")) + click_button(I18n.t("rooms.destroy.link_to")) expect(page).to have_content(I18n.t("rooms.destroy.success", room_name: section.name)) expect(space.rooms).not_to be_exist(id: section.id) @@ -41,7 +41,7 @@ # moment - ZS 10/18/23 it "requires confirmation" do accept_alert(I18n.t("rooms.destroy.confirm", room_name: section.name)) do - click_on(I18n.t("rooms.destroy.link_to")) + click_button(I18n.t("rooms.destroy.link_to")) end expect(page).to have_content(I18n.t("rooms.destroy.success", room_name: section.name))