Sha256: eacd22ac5af990bdf98bb5f49e3837ddddc0b789121f957eaca60a3ce4f16b44

Contents?: true

Size: 809 Bytes

Versions: 3

Compression:

Stored size: 809 Bytes

Contents

require 'test_helper'

class Kaui::AccountChildrenControllerTest < Kaui::FunctionalTestHelper

  test 'should get index' do
    get :index, :account_id => @account.account_id
    assert_response :success
  end

  test 'should list account children' do
    children_size = 3
    # create children
    for i in 1..children_size
      create_account(@tenant,USERNAME,PASSWORD,'Kaui test',nil,nil,@account.account_id)
    end

    parameters = {
        :search => { :value => @account.account_id},
        :format => :json,
        :account_id => @account.account_id
    }
    get :pagination, parameters
    assert_response :success

    body = MultiJson.decode(@response.body)

    assert_instance_of Array, body['data']
    assert_equal children_size, body['data'].size
    assert_nil body['error']
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

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