Sha256: e8194f2485b9715562a6dbaaecb8b6f3cc54fdf9b0036244a315cc813f832d74

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

require 'test_helper'

class Kaui::ChargesControllerTest < Kaui::FunctionalTestHelper

  test 'should get new for new invoice' do
    get :new, :account_id => @account.account_id
    assert_response 200
  end

  test 'should get new for existing invoice' do
    get :new, :invoice_id => @invoice_item.invoice_id
    assert_response 200
  end

  test 'should create charge' do
    post :create,
         :invoice_item => {
             :account_id  => @account.account_id,
             :amount      => 5.34,
             :currency    => 'USD',
             :description => SecureRandom.uuid
         }
    assert_redirected_to invoice_path(assigns(:charge).invoice_id)
    assert_equal 'Charge was successfully created', flash[:notice]
  end

  test 'should create charge for existing invoice' do
    post :create,
         :invoice_item => {
             :account_id  => @account.account_id,
             :invoice_id  => @invoice_item.invoice_id,
             :amount      => 5.34,
             :currency    => 'USD',
             :description => SecureRandom.uuid
         }
    assert_redirected_to invoice_path(assigns(:charge).invoice_id)
    assert_equal 'Charge was successfully created', flash[:notice]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kaui-0.11.0 test/functional/kaui/charges_controller_test.rb
kaui-0.10.0 test/functional/kaui/charges_controller_test.rb
kaui-0.9.0 test/functional/kaui/charges_controller_test.rb
kaui-0.8.4 test/functional/kaui/charges_controller_test.rb
kaui-0.8.3 test/functional/kaui/charges_controller_test.rb
kaui-0.8.2 test/functional/kaui/charges_controller_test.rb
kaui-0.8.1 test/functional/kaui/charges_controller_test.rb
kaui-0.8.0 test/functional/kaui/charges_controller_test.rb
kaui-0.7.2 test/functional/kaui/charges_controller_test.rb
kaui-0.7.1 test/functional/kaui/charges_controller_test.rb
kaui-0.7.0 test/functional/kaui/charges_controller_test.rb