Sha256: bd25e1efdd43c154ec6d36380be6f7fabfa44e1b8a06940d8f73d4b738c444b0

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'

class Kaui::AccountCustomFieldsControllerTest < Kaui::FunctionalTestHelper

  test 'should list all account custom fields' do
    new_account = create_account(@tenant)

    # set a custom field
    created_custom_field = Kaui::CustomField.new
    created_custom_field.object_id = new_account.account_id
    created_custom_field.object_type = 'ACCOUNT'
    created_custom_field.name = 'test'
    created_custom_field.value = 'value'

    new_account.add_custom_field(created_custom_field, 'Kaui test', nil, nil, build_options(@tenant, USERNAME, PASSWORD))


    # get custom field list
    get :index, :account_id => new_account.account_id
    assert_response :success
    custom_fields_from_response = get_value_from_input_field('custom-fields').gsub!('&quot;','"');
    assert_not_nil custom_fields_from_response
    custom_fields = JSON.parse(custom_fields_from_response)
    assert_equal 1, custom_fields.count
    assert_equal 'ACCOUNT', custom_fields[0][1]
    assert_equal 'test', custom_fields[0][2]
    assert_equal 'value', custom_fields[0][3]
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kaui-2.1.0 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-2.0.4 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-2.0.3 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-2.0.2 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-2.0.1 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-2.0.0 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-1.4.1 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-1.4.0 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-1.3.0 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-1.2.0 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-1.1.0 test/functional/kaui/account_custom_fields_controller_test.rb
kaui-1.0.0 test/functional/kaui/account_custom_fields_controller_test.rb