Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spree Upgrade][FrontOffice] Fix checkout feature specs (2 broken tests) #2999

Closed
HugsDaniel opened this issue Nov 8, 2018 · 12 comments
Closed
Assignees

Comments

@HugsDaniel
Copy link
Contributor

Description

Several specs are failing in spec/features/consumer/shopping/checkout_spec.rb, we have to fix them.
This is a first placeholder for these specs, I may open several issues later on.

Expected Behavior

Specs should pass.

Actual Behavior

Specs fail.

@HugsDaniel HugsDaniel self-assigned this Nov 8, 2018
@luisramos0 luisramos0 changed the title [Spree Upgrade] Fix checkout feature specs [Spree Upgrade] Fix checkout feature specs (11 broken tests) Nov 13, 2018
@HugsDaniel HugsDaniel removed their assignment Nov 13, 2018
@luisramos0
Copy link
Contributor

luisramos0 commented Nov 16, 2018

There were 11 broken tests here, with PR #3069 fixing a translation missing, this spec remains with 5 broken tests:

1

  1) As a consumer I want to check out my cart with shipping and payment methods when I have an out of stock product in my cart returns me to the cart with an error message
     Failure/Error: page.should_not have_selector 'closing', text: "Checkout now"
       expected not to find visible css "closing" with text "Checkout now", found 1 match: "Checkout now"
     # ./spec/features/consumer/shopping/checkout_spec.rb:57:in `block (4 levels) in <top (required)>'

It's showing the buttons "login or checkout as guest"
Error "item unavailable" should be shown before login verification?

2

 2) As a consumer I want to check out my cart with shipping and payment methods login in as user with details filled out allows user to save default billing address and shipping address
     Failure/Error: order.bill_address.should be_nil
     
       expected: nil
            got: #<Spree::Address id: 24, firstname: "John", lastname: "Doe", address1: "10 Lovely Street", address2: ...-16 00:06:59", updated_at: "2018-11-16 00:06:59", company: "Company", latitude: nil, longitude: nil>
     # ./spec/features/consumer/shopping/checkout_spec.rb:107:in `block (5 levels) in <top (required)>'

order.bill_address should be nil before save
Why is bill address being saved?

3

3 ) As a consumer I want to check out my cart with shipping and payment methods on the checkout page with payments open purchasing takes us to the order confirmation page when we submit a complete form
     Failure/Error: expect(page).to have_content with_currency(1.93)
       expected to find text "$1.93" in "SHOPS MAP PRODUCERS GROUPS ABOUT English Castellano English Login Shopping @ ENTERPRISE 59 0 items Enterprise 59 Herndon ABOUT ENTERPRISE 59 PRODUCERS CONTACT GROUPS Order #R608524165 Confirmed NOT PAID Total order $11.23 Paying via: Roger rabbit Billing address Will Marshall 123 Your Face, Melbourne, 3066, Victoria 0468363090 Frogs Delivery time time yellow Delivery address Will Marshall 123 Your Face, Melbourne, 3066, Victoria 0468363090 Your notes: SpEcIaL NoTeS Item Price Qty Total Product #25 - 3620 (1g) $11.23 1 $11.23 Produce $11.23 Total $11.23 (includes tax) $1.02 "
     # ./spec/features/consumer/shopping/checkout_spec.rb:379:in `block (5 levels) in <top (required)>'

Found 1.02 instead of $1.93. $0.91 is either the product tax or the shipping tax missing.

4

  4) As a consumer I want to check out my cart with shipping and payment methods on the checkout page with payments open purchasing with basic details filled takes us to the cart page with an error when a product becomes out of stock just before we purchase
     Failure/Error: page.should have_selector 'closing', text: "Your shopping cart"
       expected to find visible css "closing" with text "Your shopping cart" but there were no matches
     # ./spec/features/consumer/shopping/checkout_spec.rb:420:in `block (6 levels) in <top (required)>'

variant.on_hand = 0
This is not triggering the expected behaviour.

5

) As a consumer I want to check out my cart with shipping and payment methods on the checkout page with payments open purchasing with basic details filled when we are charged a shipping fee creates a payment for the full amount inclusive of shipping
     Failure/Error: o.adjustments.shipping.first.amount.should == 4.56

       expected: 4.56
            got: 0.0 (#<BigDecimal:7ffb56ec52d0,'0.0',9(18)>) (using ==)
     # ./spec/features/consumer/shopping/checkout_spec.rb:433:in `block (7 levels) in <top (required)>'

This one will be fixed as part of #2683

@luisramos0
Copy link
Contributor

Feel free to pick any of the remaining broken tests. I think I'll look at something else now :-)

@HugsDaniel
Copy link
Contributor Author

Two failures remain, which seem related to shipping tax calculations :

1) As a consumer I want to check out my cart with shipping and payment methods on the checkout page with payments open purchasing takes us to the order confirmation page when we submit a complete form
     Failure/Error: expect(page).to have_content with_currency(1.93)
       expected to find text "$1.93" in "SHOPS MAP PRODUCERS GROUPS ABOUT English Castellano English Français Login Shopping @ ENTERPRISE 47 0 items Enterprise 47 Herndon ABOUT ENTERPRISE 47 PRODUCERS CONTACT GROUPS Order #R883562774 Confirmed NOT PAID Total order $11.23 Paying via: Roger rabbit Billing address Will Marshall 123 Your Face, Melbourne, 3066, Victoria 0468363090 Frogs Delivery time time yellow Delivery address Will Marshall 123 Your Face, Melbourne, 3066, Victoria 0468363090 Your notes: SpEcIaL NoTeS Item Price Qty Total Product #21 - 6766 (1g) $11.23 1 $11.23 Produce $11.23 Total $11.23 (includes tax) $1.02 Back To Store Interested in getting on the Open Food Network? Register here OFN Global Home | News | About | Contact OFN Sites Developer | Community | User Guide Secure and trusted. Open Food Network uses SSL encryption (2048 bit RSA) everywhere to keep your shopping and payment information private. Our servers do not store your credit card details and payments are processed by PCI-compliant services. Keep in touch Email us Newsletter sign-up News Calendar Navigate Shops Map Producers Groups About Join us Create a listing, shop or group directory on the Open Food Network. Tell me more! Read our Terms and conditions | Find us on GitHub Open Food Network is a free and open source software platform. Our content is licensed with CC BY-SA 3.0 and our code with AGPL 3. We take good care of your data. See our cookies policy"
     # ./spec/features/consumer/shopping/checkout_spec.rb:380:in `block (5 levels) in <top (required)>'
     # -e:1:in `<main>'
 2) As a consumer I want to check out my cart with shipping and payment methods on the checkout page with payments open purchasing with basic details filled when we are charged a shipping fee creates a payment for the full amount inclusive of shipping
     Failure/Error: o.adjustments.shipping.first.amount.should == 4.56
     
       expected: 4.56
            got: 0.0 (#<BigDecimal:5604ec3aa470,'0.0',9(18)>) (using ==)
     # ./spec/features/consumer/shopping/checkout_spec.rb:435:in `block (7 levels) in <top (required)>'
     # -e:1:in `<main>'

I'm not really sure how to tackle these ones. @luisramos0 @sauloperez do you master these adjustment calculation processes ? I'd be up for a quick explanation so I can solve these two.

@luisramos0
Copy link
Contributor

Hey @HugsDaniel I think it's better to leave these 2 with shipping fees for later, after #2683.
Actually, if we rebase #2775 after your #3100 is merged we may see these will be fixed already :-)

@luisramos0 luisramos0 changed the title [Spree Upgrade] Fix checkout feature specs (11 broken tests) [Spree Upgrade][FrotnOffice] Fix checkout feature specs (11 broken tests) Nov 22, 2018
@sigmundpetersen sigmundpetersen changed the title [Spree Upgrade][FrotnOffice] Fix checkout feature specs (11 broken tests) [Spree Upgrade][FrontOffice] Fix checkout feature specs (11 broken tests) Nov 22, 2018
@HugsDaniel
Copy link
Contributor Author

Hey @luisramos0 can you try rebasing #2775 to see if #3100 fixed these specs ?

@luisramos0
Copy link
Contributor

done, thanks for the heads up!

@luisramos0
Copy link
Contributor

confirmed, 2775 fixes the remaining 2 specs :-D

@HugsDaniel
Copy link
Contributor Author

feelsgood

@sigmundpetersen
Copy link
Contributor

So we can close? @luisramos0

@luisramos0
Copy link
Contributor

no, only #2775 will close this. I need to write new specs as part of 2775 wip

@sigmundpetersen
Copy link
Contributor

Alrighty 👍

@sigmundpetersen sigmundpetersen changed the title [Spree Upgrade][FrontOffice] Fix checkout feature specs (11 broken tests) [Spree Upgrade][FrontOffice] Fix checkout feature specs (2 broken tests) Dec 5, 2018
@luisramos0
Copy link
Contributor

closed by #2775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants