Sha256: aa07ab68cd8671ce76e30ac4e83cb20d9260cbe5f1b1c0fa16fcc5bb67c9bab2
Contents?: true
Size: 784 Bytes
Versions: 5
Compression:
Stored size: 784 Bytes
Contents
require 'spec_helper' describe Spree::Admin::RefundsController do stub_authorization! describe "POST create" do context "a Spree::Core::GatewayError is raised" do let(:payment) { create(:payment) } subject do post :create, refund: { amount: "50.0", refund_reason_id: "1" }, order_id: payment.order_id, payment_id: payment.id end before(:each) do def controller.create raise Spree::Core::GatewayError.new('An error has occurred') end end it "sets an error message with the correct text" do subject expect(flash[:error]).to eq 'An error has occurred' end it { is_expected.to render_template(:new) } end end end
Version data entries
5 entries across 5 versions & 1 rubygems