mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
parent
340e61804b
commit
4b836f1476
23 changed files with 54 additions and 47 deletions
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
class Repp::DomainTransfersTest < ActionDispatch::IntegrationTest
|
||||
def test_post_to_domain_transfers
|
||||
request_params = { format: :json, domainTransfers: [{ domainName: domains(:shop).name, authInfo: domains(:shop).auth_info }] }
|
||||
request_params = { format: :json, domainTransfers: [{ domainName: domains(:shop).name, transferCode: domains(:shop).transfer_code }] }
|
||||
post '/repp/v1/domain_transfers', request_params, { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||
assert_response :created
|
||||
|
||||
|
|
6
test/fixtures/domains.yml
vendored
6
test/fixtures/domains.yml
vendored
|
@ -3,7 +3,7 @@ shop:
|
|||
name_dirty: shop.test
|
||||
registrar: bestnames
|
||||
registrant: john
|
||||
auth_info: 65078d5
|
||||
transfer_code: 65078d5
|
||||
valid_to: 2010-07-05
|
||||
period: 1
|
||||
period_unit: m
|
||||
|
@ -13,7 +13,7 @@ airport:
|
|||
name_dirty: airport.test
|
||||
registrar: bestnames
|
||||
registrant: john
|
||||
auth_info: 55438j5
|
||||
transfer_code: 55438j5
|
||||
valid_to: 2010-07-05
|
||||
period: 1
|
||||
period_unit: m
|
||||
|
@ -23,7 +23,7 @@ library:
|
|||
name_dirty: library.test
|
||||
registrar: bestnames
|
||||
registrant: acme_ltd
|
||||
auth_info: 45118f5
|
||||
transfer_code: 45118f5
|
||||
valid_to: 2010-07-05
|
||||
period: 1
|
||||
period_unit: m
|
||||
|
|
|
@ -7,7 +7,7 @@ class RegistrarDomainsTest < ActionDispatch::IntegrationTest
|
|||
|
||||
def test_downloads_domain_list_as_csv
|
||||
expected_csv = <<-CSV.strip_heredoc
|
||||
Domain,Auth info,Registrant name,Registrant code,Date of expiry
|
||||
Domain,Transfer code,Registrant name,Registrant code,Date of expiry
|
||||
library.test,45118f5,Acme Ltd,acme-ltd-001,2010-07-05
|
||||
shop.test,65078d5,John,john-001,2010-07-05
|
||||
airport.test,55438j5,John,john-001,2010-07-05
|
||||
|
|
|
@ -9,28 +9,28 @@ class DomainTest < ActiveSupport::TestCase
|
|||
assert @domain.valid?
|
||||
end
|
||||
|
||||
def test_generates_random_auth_info_if_new
|
||||
def test_generates_random_transfer_code_if_new
|
||||
domain = Domain.new
|
||||
another_domain = Domain.new
|
||||
|
||||
refute_empty domain.auth_info
|
||||
refute_empty another_domain.auth_info
|
||||
refute_equal domain.auth_info, another_domain.auth_info
|
||||
refute_empty domain.transfer_code
|
||||
refute_empty another_domain.transfer_code
|
||||
refute_equal domain.transfer_code, another_domain.transfer_code
|
||||
end
|
||||
|
||||
def test_does_not_regenerate_auth_info_if_persisted
|
||||
original_auth_info = @domain.auth_info
|
||||
def test_does_not_regenerate_transfer_code_if_persisted
|
||||
original_transfer_code = @domain.transfer_code
|
||||
@domain.save!
|
||||
@domain.reload
|
||||
assert_equal original_auth_info, @domain.auth_info
|
||||
assert_equal original_transfer_code, @domain.transfer_code
|
||||
end
|
||||
|
||||
def test_transfers_domain
|
||||
old_auth_info = @domain.auth_info
|
||||
old_transfer_code = @domain.transfer_code
|
||||
new_registrar = registrars(:goodnames)
|
||||
@domain.transfer(new_registrar)
|
||||
|
||||
assert_equal new_registrar, @domain.registrar
|
||||
refute_same @domain.auth_info, old_auth_info
|
||||
refute_same @domain.transfer_code, old_transfer_code
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue