Skip to content

Commit

Permalink
add test for previous vat-included prices fix, fix #129
Browse files Browse the repository at this point in the history
  • Loading branch information
alepore committed Jul 3, 2015
1 parent 45640c5 commit 719a8d7
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions spec/features/paypal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,48 @@ def fill_in_guest
end
end

context "can process an order with Tax included prices" do
let(:tax_rate) { create(:tax_rate, name: 'VAT Tax', amount: 0.1,
zone: Spree::Zone.first, included_in_price: true) }
let(:tax_category) { create(:tax_category, tax_rates: [tax_rate]) }
let(:product3) { FactoryGirl.create(:product, name: 'EU Charger', tax_category: tax_category) }
let(:tax_string) { "VAT Tax 10.0%" }

# Regression test for #129
context "on countries where the Tax is applied" do

before do
Spree::Zone.first.update_attribute(:default_tax, true)
end

xit do

This comment has been minimized.

Copy link
@mleglise

mleglise Jul 31, 2015

Does this test even run? xit normally marks a test as pending.

This comment has been minimized.

Copy link
@alepore

alepore Aug 1, 2015

Author Member

all integrations tests are currently disabled due to random paypal UI behavior...

add_to_cart(product3)
visit '/cart'

within("#cart_adjustments") do
page.should have_content("#{tax_string} (Included in Price)")
end

click_button 'Checkout'
fill_in_guest
fill_in_billing
click_button "Save and Continue"
click_button "Save and Continue"
find("#paypal_button").click

within_transaction_cart do
# included taxes should not go on paypal
page.should_not have_content(tax_string)
end

login_to_paypal
click_button "Pay Now"
page.should have_content("Your order has been processed successfully")
end
end

end

context "as an admin" do
stub_authorization!

Expand Down

0 comments on commit 719a8d7

Please sign in to comment.