mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-31 06:31:41 +00:00
Calculator 'None' is the default one for both shipping and payment method
+ update specs as well Update shipping_method.rb
This commit is contained in:
@@ -247,10 +247,13 @@ describe '
|
||||
end
|
||||
|
||||
describe "Setting transaction fees", js: true do
|
||||
let(:calculator) { build(:calculator) }
|
||||
let!(:payment_method) { create(:payment_method, calculator: calculator) }
|
||||
let!(:payment_method) { create(:payment_method) }
|
||||
before { login_as_admin_and_visit spree.edit_admin_payment_method_path payment_method }
|
||||
|
||||
it "set by default 'None' as calculator" do
|
||||
expect(page).to have_select "calc_type", selected: "None"
|
||||
end
|
||||
|
||||
it "handle the 'None' calculator" do
|
||||
select2_select "None", from: 'calc_type'
|
||||
click_button 'Update'
|
||||
@@ -273,9 +276,11 @@ describe '
|
||||
end
|
||||
|
||||
context "using Flat Rate (per order) calculator" do
|
||||
# flat rate per order is the default calculator; no need select it and update page
|
||||
before { select2_select "Flat Rate (per order)", from: 'calc_type' }
|
||||
|
||||
it "inserts values which persist" do
|
||||
expect(page).to have_content("you must save first before")
|
||||
click_button 'Update'
|
||||
fill_in "Amount", with: 2.2
|
||||
click_button 'Update'
|
||||
expect(page).to have_content("Payment Method has been successfully updated!")
|
||||
|
||||
Reference in New Issue
Block a user