Sha256: 172cf8742dd604571e97228c88585a4ddbc32b624ca79e33b79bbc45db10e4fd
Contents?: true
Size: 787 Bytes
Versions: 32
Compression:
Stored size: 787 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, params: { 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
32 entries across 32 versions & 1 rubygems