From d7b19750e5c5d145decc4fb083c6be92b043244a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 11 Sep 2018 17:50:34 +1000 Subject: [PATCH] Add spec for GH issue #2655 --- spec/features/admin/payments_spec.rb | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 spec/features/admin/payments_spec.rb diff --git a/spec/features/admin/payments_spec.rb b/spec/features/admin/payments_spec.rb new file mode 100644 index 0000000000..2a41484813 --- /dev/null +++ b/spec/features/admin/payments_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +feature ' + As an admin + I want to manage payments +' do + include AuthenticationWorkflow + + let(:order) { create(:completed_order_with_fees) } + + scenario "visiting the payment form" do + quick_login_as_admin + + visit spree.new_admin_order_payment_path order + + expect(page).to have_content "New Payment" + end + + context "with sensitive payment fee" do + let(:payment_method) { order.distributor.payment_methods.first } + + before do + # This calculator doesn't handle a `nil` order well. + # That has been useful in finding bugs. ;-) + payment_method.calculator = Spree::Calculator::FlatPercentItemTotal.new + payment_method.save! + end + + scenario "visiting the payment form" do + pending "fix usage of the PaymentMethodSerializer" + quick_login_as_admin + + visit spree.new_admin_order_payment_path order + + expect(page).to have_content "New Payment" + end + end +end