mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 20:27:30 +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)
|
||||
|
||||
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'))
|
||||
|
||||
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}))
|
||||
end
|
||||
|
||||
|
@ -63,12 +63,12 @@ class RegistrantApiDomainsTest < ApplicationIntegrationTest
|
|||
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
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
|
||||
response_json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_equal(4, response_json.count)
|
||||
assert_equal(4, response_json[:domains].count)
|
||||
end
|
||||
|
||||
def test_root_does_not_accept_limit_higher_than_200
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'serializers/registrant_api/contact'
|
|||
class SerializersRegistrantApiContactTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@contact = contacts(:william)
|
||||
@serializer = Serializers::RegistrantApi::Contact.new(@contact)
|
||||
@serializer = Serializers::RegistrantApi::Contact.new(@contact, false)
|
||||
@json = @serializer.to_json
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue