test/test_mxhero_api.rb in mxhero-api-0.1.10 vs test/test_mxhero_api.rb in mxhero-api-0.1.11

- old
+ new

@@ -108,9 +108,22 @@ account[:aliases].each { |t_alias| must_have_the_keys(t_alias, %w( name domain dataSource )) } end end end + def test_accounts_by_domain_filtered + VCR.use_cassette('accounts_filtered') do + # The test environment have 4 accounts: + # user_1, user_2, user_3 and test + response = @api.accounts_by_domain(domain, account: 'user') + assert_equal 3, response[:elements].count + response = @api.accounts_by_domain(domain, account: 'test') + assert_equal 1, response[:elements].count + response = @api.accounts_by_domain(domain, account: 'user_2') + assert_equal 1, response[:elements].count + end + end + def test_accounts_by_domain_paginated VCR.use_cassette('accounts_from_domain_paginated') do response = @api.accounts_by_domain(domain, limit: 4, offset: 1) must_have_the_keys(response, %w( elements totalElements totalPages actualPage )) assert_equal 4, response[:elements].count