From 9b3f3b493f0edf55449a1277a2f2d3ae9b81f9b6 Mon Sep 17 00:00:00 2001 From: Ross Chapman Date: Wed, 25 Oct 2023 17:20:29 -0700 Subject: [PATCH] Fix other specs --- .../buying_products_system_spec.rb | 10 +++---- .../collecting_payments_system_spec.rb | 26 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) 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