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

Remove unused ShippingRateTaxer service object #4136

Merged
merged 1 commit into from
Jul 30, 2021
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
2 changes: 1 addition & 1 deletion core/app/models/spree/shipping_rate_tax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Spree
# @attr [Spree::ShippingRate] shipping_rate The shipping rate to be taxed
# @attr [Spree::TaxRate] tax_rate The tax rate used to calculate the tax amount
# @since 1.3.0
# @see Spree::Tax::ShippingRateTaxer
# @see Spree::Stock::Estimator
class ShippingRateTax < Spree::Base
belongs_to :shipping_rate, class_name: "Spree::ShippingRate", optional: true
belongs_to :tax_rate, class_name: "Spree::TaxRate", optional: true
Expand Down
24 changes: 0 additions & 24 deletions core/app/models/spree/tax/shipping_rate_taxer.rb

This file was deleted.

2 changes: 1 addition & 1 deletion core/app/models/spree/tax_calculator/shipping_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module TaxCalculator
# looking to provide their own calculator should adhere to the API of this
# class.
#
# @see Spree::Tax::ShippingRateTaxer
# @see Spree::Stock::Estimator
class ShippingRate
include Spree::Tax::TaxHelpers

Expand Down
20 changes: 17 additions & 3 deletions core/spec/models/spree/shipping_rate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
let(:order_address) { address }

before do
Spree::Tax::ShippingRateTaxer.new.tax(shipping_rate)
shipping_rate.taxes.build(
amount: 0.91,
tax_rate: tax_rate,
)
end

it "shows correct tax amount" do
Expand Down Expand Up @@ -68,7 +71,10 @@
let(:order_address) { address }

before do
Spree::Tax::ShippingRateTaxer.new.tax(shipping_rate)
shipping_rate.taxes.build(
amount: 1.0,
tax_rate: tax_rate,
)
end

it "shows correct tax amount" do
Expand Down Expand Up @@ -107,7 +113,15 @@
let(:order_address) { address }

before do
Spree::Tax::ShippingRateTaxer.new.tax(shipping_rate)
shipping_rate.taxes.build(
amount: 1.0,
tax_rate: tax_rate,
)

shipping_rate.taxes.build(
amount: 0.5,
tax_rate: other_tax_rate,
)
end

it "shows correct tax amount" do
Expand Down
59 changes: 0 additions & 59 deletions core/spec/models/spree/tax/shipping_rate_taxer_spec.rb

This file was deleted.