This repository was archived by the owner on Apr 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from seand7565/sanitize
Sanitize user address json for PayPal button
- Loading branch information
Showing
2 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,21 +60,19 @@ | |
before do | ||
payment_method | ||
add_mug_to_cart | ||
end | ||
|
||
it "checks out successfully", skip: "Broken. To be revisited" do | ||
click_button("Checkout") | ||
fill_in("order_email", with: "[email protected]") | ||
|
||
fill_in("order_email", with: "[email protected]") | ||
click_button("Continue") | ||
expect(page).to have_content("Customer E-Mail") | ||
|
||
fill_in_address | ||
click_button("Save and Continue") | ||
|
||
expect(page).to have_content("SHIPPING METHOD") | ||
click_button("Save and Continue") | ||
end | ||
|
||
it "formats the address variable correctly" do | ||
expect(page.evaluate_script("address['recipientName']")).to eq "Ryan Bigg" | ||
end | ||
|
||
it "checks out successfully", skip: "Broken. To be revisited" do | ||
pend_if_paypal_slow do | ||
expect_any_instance_of(Spree::Order).not_to receive(:restart_checkout_flow) | ||
move_through_paypal_popup | ||
|
@@ -136,8 +134,12 @@ def move_through_paypal_popup | |
|
||
def fill_in_address | ||
address = "order_bill_address_attributes" | ||
fill_in "#{address}_firstname", with: "Ryan" | ||
fill_in "#{address}_lastname", with: "Bigg" | ||
if page.has_css?("##{address}_firstname", wait: 0) | ||
fill_in "#{address}_firstname", with: "Ryan" | ||
fill_in "#{address}_lastname", with: "Bigg" | ||
else | ||
fill_in "#{address}_name", with: "Ryan Bigg" | ||
end | ||
fill_in "#{address}_address1", with: "143 Swan Street" | ||
fill_in "#{address}_city", with: "San Jose" | ||
select "United States of America", from: "#{address}_country_id" | ||
|