Sha256: 31a7facf5580e78b83486433941b7377a3411478c8b2903d9817bb50ff7ead3c

Contents?: true

Size: 1.16 KB

Versions: 11

Compression:

Stored size: 1.16 KB

Contents

require 'test_helper'

class Kaui::InvoiceItemsControllerTest < Kaui::FunctionalTestHelper

  test 'should get edit' do
    get :edit, :invoice_id => @invoice_item.invoice_id, :id => @invoice_item.invoice_item_id
    assert_response 200
    assert_equal @invoice_item.invoice_item_id, assigns(:invoice_item).invoice_item_id
  end

  test 'should adjust invoice item' do
    put :update,
        :id           => @invoice_item.invoice_item_id,
        :invoice_item => {
            :account_id      => @account.account_id,
            :invoice_id      => @invoice_item.invoice_id,
            :invoice_item_id => @invoice_item.invoice_item_id,
            :amount          => 5.34
        }
    assert_redirected_to invoice_path(assigns(:invoice_item).invoice_id)
    assert_equal 'Adjustment item was successfully created', flash[:notice]
  end

  test 'should delete CBA' do
    delete :destroy,
           :id         => @cba.invoice_item_id,
           :invoice_id => @cba.invoice_id,
           :account_id => @account.account_id
    assert_redirected_to invoice_path(assigns(:invoice_item).invoice_id)
    assert_equal 'CBA item was successfully deleted', flash[:notice]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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