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

Fix broken specs #328

Merged
merged 4 commits into from
Nov 18, 2022
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
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ require:
- solidus_dev_support/rubocop

AllCops:
NewCops: enable
TargetRubyVersion: 2.6
NewCops: disable

Layout/FirstArgumentIndentation:
EnforcedStyle: consistent
Expand Down
13 changes: 6 additions & 7 deletions spec/features/frontend/braintree_credit_card_checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:three_d_secure_enabled) { false }
let(:venmo_enabled) { false }
let(:card_number) { "4111111111111111" }
let(:card_expiration) { "01/#{Time.now.utc.year + 2}" }
let(:card_expiration) { "01/#{Time.now.utc.year + 3}" }

before do
braintree.save!
Expand Down Expand Up @@ -107,7 +107,6 @@

context 'with 3D secure enabled' do
let(:three_d_secure_enabled) { true }
let(:card_number) { "4000000000000002" }

it 'checks out successfully' do
authenticate_3ds
Expand All @@ -121,7 +120,7 @@
end

context 'with 3ds authentication error' do
let(:card_number) { "4000000000000028" }
let(:card_number) { "4000000000001125" }

it 'shows a 3ds authentication error' do
authenticate_3ds
Expand Down Expand Up @@ -183,10 +182,10 @@

def authenticate_3ds
within_frame("Cardinal-CCA-IFrame") do
within_frame("authWindow") do
fill_in("password", with: "1234")
click_button("Submit")
end
fill_in("challengeDataEntry", with: "1234")
continue_button = find_button("SUBMIT")
continue_button.scroll_to(continue_button)
continue_button.click
end
end
end
89 changes: 52 additions & 37 deletions spec/fixtures/cassettes/checkout/valid_credit_card.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
)
end

before do
create(:state, state_code: "WA")
end

it { is_expected.to be false }

it "sets useful error messages" do
Expand Down Expand Up @@ -115,7 +119,6 @@
}
let(:payment_method) { create_gateway }

let(:country) { create :country, iso: 'US', states_required: true }
let(:transaction_address) { nil }
let(:end_state) { 'confirm' }

Expand All @@ -132,7 +135,6 @@

before do
# create a shipping method so we can push through to the end
country
create :shipping_method, cost: 5

# ensure payments have the same number so VCR matches the request body
Expand Down
1 change: 1 addition & 0 deletions spec/models/solidus_paypal_braintree/transaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

before do
create(:country, iso: "US")
create(:state, state_code: "WA")
end

it { is_expected.to be true }
Expand Down