Sha256: 6a13f82238fab4e0a46e2933f43258fc5c18852d562ef6c55fe901748827c76b
Contents?: true
Size: 1.57 KB
Versions: 14
Compression:
Stored size: 1.57 KB
Contents
require 'test_helper' class Kaui::ChargebacksControllerTest < Kaui::FunctionalTestHelper test 'should handle Kill Bill errors in new screen' do payment_id = SecureRandom.uuid.to_s get :new, :account_id => @account.account_id, :payment_id => payment_id assert_redirected_to account_path(@account.account_id) assert_equal "Error while communicating with the Kill Bill server: Error 404: Object id=#{payment_id} type=PAYMENT doesn't exist!", flash[:error] end test 'should get new' do get :new, :account_id => @account.account_id, :payment_id => @payment.payment_id assert_response 200 end test 'should handle Kill Bill errors during create' do payment_id = SecureRandom.uuid.to_s post :create, :account_id => @account.account_id, :chargeback => { :payment_id => payment_id, :amount => @payment.paid_amount_to_money.to_f, :currency => @payment.currency } assert_template :new assert_equal "Error while creating a new chargeback: Error 404: Object id=#{payment_id} type=PAYMENT doesn't exist!", flash[:error] end test 'should create chargeback' do post :create, :account_id => @payment.account_id, :chargeback => { :payment_id => @payment.payment_id, :amount => @payment.paid_amount_to_money.to_f, :currency => @payment.currency }, :cancel_all_subs => '1' assert_redirected_to account_payment_path(@payment.account_id, @payment.payment_id) assert_equal 'Chargeback created', flash[:notice] end end
Version data entries
14 entries across 14 versions & 1 rubygems