Skip to content

Commit

Permalink
Fix other specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rosschapman committed Oct 26, 2023
1 parent 139e88a commit 9b3f3b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions spec/furniture/marketplace/buying_products_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]",
Expand Down Expand Up @@ -62,19 +62,19 @@ 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

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)
Expand Down
26 changes: 13 additions & 13 deletions spec/furniture/marketplace/collecting_payments_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 9b3f3b4

Please sign in to comment.