mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove Spree::Config[:shipping_tax_rate]
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user