Sha256: 7af908541f5a16a746d924a8239fd7592b6f1b9f10e2feccc3352c5c8d2d8ede
Contents?: true
Size: 795 Bytes
Versions: 22
Compression:
Stored size: 795 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 spree_post :create, refund: { amount: "50.0", refund_reason_id: "1" }, order_id: payment.order.to_param, payment_id: payment.to_param 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 { should render_template(:new) } end end end
Version data entries
22 entries across 22 versions & 1 rubygems