mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
Reflect new behaviour of registrant API in tests
This commit is contained in:
parent
15d2ffe200
commit
92b294e81b
2 changed files with 5 additions and 5 deletions
|
@ -50,10 +50,10 @@ class RegistrantApiDomainsTest < ApplicationIntegrationTest
|
||||||
assert_equal(200, response.status)
|
assert_equal(200, response.status)
|
||||||
|
|
||||||
response_json = JSON.parse(response.body, symbolize_names: true)
|
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||||
array_of_domain_names = response_json.map { |x| x[:name] }
|
array_of_domain_names = response_json[:domains].map { |x| x[:name] }
|
||||||
assert(array_of_domain_names.include?('hospital.test'))
|
assert(array_of_domain_names.include?('hospital.test'))
|
||||||
|
|
||||||
array_of_domain_registrars = response_json.map { |x| x[:registrar] }
|
array_of_domain_registrars = response_json[:domains].map { |x| x[:registrar] }
|
||||||
assert(array_of_domain_registrars.include?({name: 'Good Names', website: nil}))
|
assert(array_of_domain_registrars.include?({name: 'Good Names', website: nil}))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -63,12 +63,12 @@ class RegistrantApiDomainsTest < ApplicationIntegrationTest
|
||||||
response_json = JSON.parse(response.body, symbolize_names: true)
|
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||||
|
|
||||||
assert_equal(200, response.status)
|
assert_equal(200, response.status)
|
||||||
assert_equal(2, response_json.count)
|
assert_equal(2, response_json[:domains].count)
|
||||||
|
|
||||||
get '/api/v1/registrant/domains', headers: @auth_headers
|
get '/api/v1/registrant/domains', headers: @auth_headers
|
||||||
response_json = JSON.parse(response.body, symbolize_names: true)
|
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||||
|
|
||||||
assert_equal(4, response_json.count)
|
assert_equal(4, response_json[:domains].count)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_root_does_not_accept_limit_higher_than_200
|
def test_root_does_not_accept_limit_higher_than_200
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'serializers/registrant_api/contact'
|
||||||
class SerializersRegistrantApiContactTest < ActiveSupport::TestCase
|
class SerializersRegistrantApiContactTest < ActiveSupport::TestCase
|
||||||
def setup
|
def setup
|
||||||
@contact = contacts(:william)
|
@contact = contacts(:william)
|
||||||
@serializer = Serializers::RegistrantApi::Contact.new(@contact)
|
@serializer = Serializers::RegistrantApi::Contact.new(@contact, false)
|
||||||
@json = @serializer.to_json
|
@json = @serializer.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue