diff --git a/app/views/spree/admin/payment_methods/_providers.html.haml b/app/views/spree/admin/payment_methods/_providers.html.haml index fbbb6fec96..942a2a0c8f 100644 --- a/app/views/spree/admin/payment_methods/_providers.html.haml +++ b/app/views/spree/admin/payment_methods/_providers.html.haml @@ -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" } diff --git a/spec/system/admin/payment_method_spec.rb b/spec/system/admin/payment_method_spec.rb index 582cdec8ac..2ee60b3c2b 100644 --- a/spec/system/admin/payment_method_spec.rb +++ b/spec/system/admin/payment_method_spec.rb @@ -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'