Sha256: 254844506680ff13c4bb60270c90ff5185b471f2ca3d10489575a3b81dddbe2f

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

class Kaui::AccountTagsControllerTest < Kaui::FunctionalTestHelper

  test 'should handle Kill Bill errors when getting edit screen' do
    account_id = '1234'
    get :edit, :account_id => account_id
    assert_redirected_to account_path(account_id)
    assert_equal 'Error while communicating with the Kill Bill server: Error 404: ', flash[:error]
  end

  test 'should get edit' do
    get :edit, :account_id => @account.account_id
    assert_response 200
    assert_not_nil assigns(:account_id)
    assert_not_nil assigns(:tag_names)
    assert_not_nil assigns(:available_tags)
  end

  test 'should update tags' do
    post :update,
         :account_id => @account.account_id,
         :'tag_00000000-0000-0000-0000-000000000001' => 'AUTO_PAY_OFF',
         :'tag_00000000-0000-0000-0000-000000000005' => 'MANUAL_PAY',
         :'tag_00000000-0000-0000-0000-000000000003' => 'OVERDUE_ENFORCEMENT_OFF'
    assert_redirected_to account_path(@account.account_id)
    assert_equal 'Account tags successfully set', flash[:notice]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaui-0.16.2 test/functional/kaui/account_tags_controller_test.rb
kaui-0.16.1 test/functional/kaui/account_tags_controller_test.rb
kaui-0.16.0 test/functional/kaui/account_tags_controller_test.rb