Sha256: 61adb8371ebd2c06b22d498a137aef75cedac5299bbf16ba6f56926a8b96c3c5
Contents?: true
Size: 791 Bytes
Versions: 16
Compression:
Stored size: 791 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_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
16 entries across 16 versions & 1 rubygems