Remove Spree::Config[:shipping_tax_rate]

This commit is contained in:
Matt-Yorkley
2021-03-06 17:58:35 +00:00
parent a26880a3a1
commit 903788903b
5 changed files with 1 additions and 14 deletions

View File

@@ -16,8 +16,7 @@ module Spree
def preferences_params
params.require(:preferences).permit(
:products_require_tax_category,
:shipment_inc_vat,
:shipping_tax_rate,
:shipment_inc_vat
)
end
end

View File

@@ -118,7 +118,6 @@ module Spree
# Tax Preferences
preference :products_require_tax_category, :boolean, default: false
preference :shipping_tax_rate, :decimal, default: 0
# Monitoring
preference :last_job_queue_heartbeat_at, :string, default: nil

View File

@@ -15,9 +15,5 @@
= check_box_tag 'preferences[shipment_inc_vat]', '1', Spree::Config[:shipment_inc_vat]
= label_tag nil, t(:shipment_inc_vat)
.field.align-center{ "data-hook" => "shipping_tax_rate" }
= number_field_tag "preferences[shipping_tax_rate]", Spree::Config[:shipping_tax_rate].to_f, in: 0.0..1.0, step: 0.01
= label_tag nil, t(:shipping_tax_rate)
.form-buttons{"data-hook" => "buttons"}
= button t(:update), 'icon-refresh'

View File

@@ -9,7 +9,6 @@ describe Spree::Admin::TaxSettingsController, type: :controller do
preferences: {
products_require_tax_category: "1",
shipment_inc_vat: "0",
shipping_tax_rate: "0.1",
}
}
}
@@ -25,13 +24,11 @@ describe Spree::Admin::TaxSettingsController, type: :controller do
[
Spree::Config[:products_require_tax_category],
Spree::Config[:shipment_inc_vat],
Spree::Config[:shipping_tax_rate],
]
}.to(
[
true,
false,
0.1,
]
)
end

View File

@@ -11,7 +11,6 @@ feature 'Account and Billing Settings' do
Spree::Config.set(
products_require_tax_category: false,
shipment_inc_vat: false,
shipping_tax_rate: 0
)
end
@@ -22,7 +21,6 @@ feature 'Account and Billing Settings' do
expect(page).to have_unchecked_field 'preferences_products_require_tax_category'
expect(page).to have_unchecked_field 'preferences_shipment_inc_vat'
expect(page).to have_field 'preferences_shipping_tax_rate'
end
it "attributes can be changed" do
@@ -30,13 +28,11 @@ feature 'Account and Billing Settings' do
check 'preferences_products_require_tax_category'
check 'preferences_shipment_inc_vat'
fill_in 'preferences_shipping_tax_rate', with: '0.12'
click_button "Update"
expect(Spree::Config.products_require_tax_category).to be true
expect(Spree::Config.shipment_inc_vat).to be true
expect(Spree::Config.shipping_tax_rate).to eq 0.12
end
end
end