mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
added test for total count
This commit is contained in:
parent
e488c839dd
commit
d19bb69342
1 changed files with 9 additions and 0 deletions
|
@ -89,6 +89,15 @@ class RegistrantApiDomainsTest < ApplicationIntegrationTest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_domains_total_if_an_incomplete_list_is_returned
|
||||||
|
get '/api/v1/registrant/domains', headers: @auth_headers, params: { 'offset' => 0 }
|
||||||
|
assert_equal(200, response.status)
|
||||||
|
|
||||||
|
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||||
|
assert_equal response_json[:domains].length, 4
|
||||||
|
assert_equal response_json[:total], 5
|
||||||
|
end
|
||||||
|
|
||||||
def test_root_accepts_limit_and_offset_parameters
|
def test_root_accepts_limit_and_offset_parameters
|
||||||
get '/api/v1/registrant/domains', params: { 'limit' => 2, 'offset' => 0 },
|
get '/api/v1/registrant/domains', params: { 'limit' => 2, 'offset' => 0 },
|
||||||
headers: @auth_headers
|
headers: @auth_headers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue