Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Fix feature specs with new CC expiration date #253

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions spec/features/backend/new_payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let!(:gateway) { create :payment_method }
let!(:order) { create(:completed_order_with_totals, number: 'R9999999') }
let(:pending_case_insensitive) { /pending/i }
let(:expiration) { "02/#{Date.current.year.next}"}

before(:each) do
braintree.save!
Expand Down Expand Up @@ -44,7 +45,7 @@
fill_in("credit-card-number", with: "4111111111111111")
end
within_frame("braintree-hosted-field-expirationDate") do
fill_in("expiration", with: "02/2020")
fill_in("expiration", with: expiration)
end
within_frame("braintree-hosted-field-cvv") do
fill_in("cvv", with: "123")
Expand Down Expand Up @@ -79,7 +80,7 @@
fill_in("credit-card-number", with: "1111111111111111")
end
within_frame("braintree-hosted-field-expirationDate") do
fill_in("expiration", with: "02/2020")
fill_in("expiration", with: expiration)
end
within_frame("braintree-hosted-field-cvv") do
fill_in("cvv", with: "123")
Expand Down Expand Up @@ -110,7 +111,7 @@
fill_in("credit-card-number", with: "4111111111111111")
end
within_frame("braintree-hosted-field-expirationDate") do
fill_in("expiration", with: "02/2020")
fill_in("expiration", with: expiration)
end
within_frame("braintree-hosted-field-cvv") do
fill_in("cvv", with: "123")
Expand Down
9 changes: 4 additions & 5 deletions spec/features/frontend/braintree_credit_card_checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
let(:braintree) { new_gateway(active: true) }
let!(:gateway) { create :payment_method }
let(:three_d_secure_enabled) { false }
let(:card_number) { "4111111111111111" }
let(:card_expiration) { "01/#{Time.now.year+2}" }
let(:card_cvv) { "123" }

before(:each) do
braintree.save!
Expand Down Expand Up @@ -49,10 +52,6 @@
cassette_name: 'checkout/valid_credit_card',
match_requests_on: [:braintree_uri]
} do
let(:card_number) { "4111111111111111" }
let(:card_expiration) { "01/#{Time.now.year+2}" }
let(:card_cvv) { "123" }

include_context "frontend checkout setup"

before do
Expand Down Expand Up @@ -136,7 +135,7 @@
fill_in("credit-card-number", with: "4111111111111111")
end
within_frame("braintree-hosted-field-expirationDate") do
fill_in("expiration", with: "02/2020")
fill_in("expiration", with: card_expiration)
end
within_frame("braintree-hosted-field-cvv") do
fill_in("cvv", with: "123")
Expand Down