Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.
Open
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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ cache: bundler
language: ruby
env:
matrix:
- SOLIDUS_BRANCH=v1.3 DB=mysql
- SOLIDUS_BRANCH=v1.3 DB=postgres
- SOLIDUS_BRANCH=v2.1 DB=mysql
- SOLIDUS_BRANCH=v2.1 DB=postgres
- SOLIDUS_BRANCH=master DB=mysql
- SOLIDUS_BRANCH=master DB=postgres
script:
- bundle exec rake test_app
- bundle exec rspec
rvm:
- 2.1.8
- 2.3.3
4 changes: 0 additions & 4 deletions app/models/spree_avatax/sales_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def update_taxes(order, tax_line_data)
finalized: true, # this tells spree not to automatically recalculate avatax tax adjustments
})

Spree::ItemAdjustments.new(record).update
record.save!
end

Expand Down Expand Up @@ -119,9 +118,6 @@ def reset_tax_attributes(order)
adjustment_total: 0,
included_tax_total: 0,
})

Spree::ItemAdjustments.new(taxable_record).update
taxable_record.save!
end

order.update_attributes!({
Expand Down
2 changes: 1 addition & 1 deletion solidus_avatax.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |s|
s.require_path = "lib"
s.requirements << "none"

s.add_dependency "solidus_core", ">= 1.3.0.alpha", "< 1.4"
s.add_dependency "solidus_core", ">= 2.1.0.rc1", "< 3"
s.add_dependency "hashie", "~> 2.l.5"
s.add_dependency "multi_json"
s.add_dependency "Avatax_TaxService", "~> 2.0.0"
Expand Down
17 changes: 13 additions & 4 deletions spec/models/spree/shipping_rate_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
require 'spec_helper'

describe Spree::ShippingRate do
let!(:tax_rate) do
rate = Spree::TaxRate.first
rate.zone.countries << shipment.order.ship_address.country
rate
end

let(:shipping_rate) do
shipment.shipping_rates.create!({
tax_rate: Spree::TaxRate.first,
shipping_method: shipping_method,
cost: 10.00,
selected: true,
selected: true
})
end

let(:shipment) { create(:shipment) }
let(:shipping_method) { create(:shipping_method) }
let(:shipping_method) { create(:shipping_method, tax_category: tax_rate.tax_category) }

before do
Spree::Config.shipping_rate_taxer_class.new.tax(shipping_rate)
end

it 'calculates shipping rate taxes as 0' do
expect(shipping_rate.calculate_tax_amount).to eq 0
expect(shipping_rate.taxes.first.amount).to eq 0
end
end