diff --git a/test/integration/admin_area/domain_update_confirms_test.rb b/test/integration/admin_area/domain_update_confirms_test.rb new file mode 100644 index 000000000..9eb79685f --- /dev/null +++ b/test/integration/admin_area/domain_update_confirms_test.rb @@ -0,0 +1,80 @@ +require 'test_helper' +require 'application_system_test_case' + +class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCase + setup do + WebMock.allow_net_connect! + sign_in users(:admin) + @domain = domains(:shop) + end + + def test_t + new_registrant = contacts(:william) + assert_not_equal new_registrant, @domain.registrant + + puts new_registrant.name + request_xml = <<-XML + + + + + + #{@domain.name} + + #{new_registrant.code} + + + + + + #{'test' * 2000} + + + + + XML + + post epp_update_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + @domain.reload + + puts @domain.registrant + end + + private + + def update_registrant_of_domain + new_registrant = contacts(:william) + assert_not_equal new_registrant, @domain.registrant + + @domain.registrant + request_xml = <<-XML + + + + + + #{@domain.name} + + #{new_registrant.code} + + + + + + #{'test' * 2000} + + + + + XML + + post epp_update_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + @domain.reload + + # puts response.body + puts @domain.registrant + end + +end \ No newline at end of file diff --git a/test/integration/repp/v1/registrar/nameservers_test.rb b/test/integration/repp/v1/registrar/nameservers_test.rb index f01769dfb..0e527da98 100644 --- a/test/integration/repp/v1/registrar/nameservers_test.rb +++ b/test/integration/repp/v1/registrar/nameservers_test.rb @@ -74,4 +74,50 @@ class ReppV1RegistrarNameserversTest < ActionDispatch::IntegrationTest assert_equal 2005, json[:code] assert_equal 'IPv6 is invalid [ipv6]', json[:message] end + + def test_ipv4_isnt_array + nameserver = nameservers(:shop_ns1) + payload = { + "data": { + "id": nameserver.hostname, + "type": "nameserver", + "domains": ["shop.test", "airport.test", "library.test", "metro.test"], + "attributes": { + "hostname": nameserver.hostname, + "ipv4": "1.1.1.1", + "ipv6": ["2620:119:352::36"] + } + } + } + + put '/repp/v1/registrar/nameservers', headers: @auth_headers, params: payload + json = JSON.parse(response.body, symbolize_names: true) + + assert_response :bad_request + assert_equal 2005, json[:code] + assert_equal 'IPv4 should be array [ipv4]', json[:message] + end + + def test_ipv6_isnt_array + nameserver = nameservers(:shop_ns1) + payload = { + "data": { + "id": nameserver.hostname, + "type": "nameserver", + "domains": ["shop.test", "airport.test", "library.test", "metro.test"], + "attributes": { + "hostname": nameserver.hostname, + "ipv4": ["1.1.1.1"], + "ipv6": "2620:119:352::36" + } + } + } + + put '/repp/v1/registrar/nameservers', headers: @auth_headers, params: payload + json = JSON.parse(response.body, symbolize_names: true) + + assert_response :bad_request + assert_equal 2005, json[:code] + assert_equal 'IPv6 should be array [ipv6]', json[:message] + end end