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:
Jean-Baptiste Bellet
2023-01-10 11:38:36 +01:00
parent a793fc9f99
commit 7015cb30c3
3 changed files with 15 additions and 4 deletions

View File

@@ -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!")