Sha256: 84afd60ebd5cea81bc9cbe469b121bcb3827baf3fb3cb00cae4a64685384808e

Contents?: true

Size: 1002 Bytes

Versions: 11

Compression:

Stored size: 1002 Bytes

Contents

require 'test_helper'

class Kaui::PaymentsControllerTest < Kaui::FunctionalTestHelper

  test 'should get index' do
    get :index
    assert_response 200
  end

  test 'should list payments' do
    # Test pagination
    get :pagination, :format => :json
    verify_pagination_results!
  end

  test 'should search payments' do
    # Test search
    get :pagination, :sSearch => 'foo', :format => :json
    verify_pagination_results!
  end

  test 'should create payments' do
    # Verify we can pre-populate the payment
    get :new, :account_id => @invoice_item.account_id, :invoice_id => @invoice_item.invoice_id
    assert_response 200
    assert_not_nil assigns(:payment)

    # Create the payment
    post :create, :invoice_payment => {:account_id => @invoice_item.account_id, :target_invoice_id => @invoice_item.invoice_id, :purchased_amount => 10}, :external => 1
    assert_response 302

    # Test pagination
    get :pagination, :format => :json
    verify_pagination_results!(1)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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