mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-22 00:57:26 +00:00
User must choose payment method type on creation
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
.alpha.four.columns
|
||||
= label :payment_method, :type, t('.provider')
|
||||
.omega.twelve.columns
|
||||
= select(:payment_method, :type, payment_method_type_options(@providers), {}, { class: 'select2 fullwidth', 'provider-prefs-for' => "#{@object.id}"})
|
||||
= select(:payment_method, :type, payment_method_type_options(@providers), {}, { class: 'select2 fullwidth', required: true, placeholder: t("admin.choose"), 'provider-prefs-for' => "#{@object.id}"})
|
||||
|
||||
%div{"ng-include" => "include_html" }
|
||||
|
||||
@@ -20,10 +20,11 @@ RSpec.describe '
|
||||
click_link 'Payment Methods'
|
||||
click_link 'New Payment Method'
|
||||
|
||||
# Selects the first one by default:
|
||||
expect(page).to have_select2 "payment_method_type", selected: "PayPal Express"
|
||||
expect(page).to have_select2 "payment_method_type", selected: "Choose..."
|
||||
|
||||
fill_in 'payment_method_name', with: 'Cheque payment method'
|
||||
cash_name = "Cash/EFT/etc. (payments for which automatic validation is not required)"
|
||||
select2_select cash_name, from: "payment_method_type"
|
||||
|
||||
check "payment_method_distributor_ids_#{@distributors[0].id}"
|
||||
click_button 'Create'
|
||||
@@ -246,6 +247,9 @@ RSpec.describe '
|
||||
it "creates payment methods" do
|
||||
visit spree.new_admin_payment_method_path
|
||||
fill_in 'payment_method_name', with: 'Cheque payment method'
|
||||
cash_name = "Cash/EFT/etc. (payments for which automatic validation is not required)"
|
||||
select2_select cash_name, from: "payment_method_type"
|
||||
|
||||
expect(page).to have_field 'payment_method_description'
|
||||
expect(page).to have_select 'payment_method_display_on'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user