From 01cee720505f659560d479c1cee66a1e2dc4585c Mon Sep 17 00:00:00 2001 From: Flavio Auciello Date: Fri, 20 Sep 2019 16:53:31 +0200 Subject: [PATCH] Add spec for custom Paypal button style at checkout --- .../features/frontend/paypal_checkout_spec.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/features/frontend/paypal_checkout_spec.rb b/spec/features/frontend/paypal_checkout_spec.rb index f2b569d1..2e5fe8cf 100644 --- a/spec/features/frontend/paypal_checkout_spec.rb +++ b/spec/features/frontend/paypal_checkout_spec.rb @@ -32,6 +32,26 @@ expect(page).to have_content("Your order has been processed successfully") end end + + context 'using custom paypal button style', vcr: { cassette_name: 'paypal/cart_checkout_with_style', match_requests_on: [:method, :uri] } do + before do + store.braintree_configuration.tap do |conf| + conf.set_preference(:paypal_button_color, 'blue') + conf.save! + end + end + + it 'should have correct locale preference' do + pend_if_paypal_slow do + expect_any_instance_of(Spree::Order).to receive(:restart_checkout_flow) + move_through_paypal_popup + + within(find('#paypal-button iframe')) do + expect(page).to have_selector('[class="paypal-button-color-blue]') + end + end + end + end end context "goes through regular checkout using paypal payment method" do