mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Add registrant area tests
This commit is contained in:
parent
ca5edb16fa
commit
5a466206bf
5 changed files with 112 additions and 1 deletions
27
test/system/registrant_area/contacts/details_test.rb
Normal file
27
test/system/registrant_area/contacts/details_test.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrantAreaContactDetailsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:registrant)
|
||||
@contact = contacts(:john)
|
||||
|
||||
Setting.days_to_keep_business_registry_cache = 1
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
end
|
||||
|
||||
def test_general_data
|
||||
visit registrant_domain_contact_url(domains(:shop), @contact)
|
||||
assert_text 'Code john-001'
|
||||
assert_text 'Name John'
|
||||
|
||||
assert_text 'Auth info'
|
||||
assert_css('[value="cacb5b"]')
|
||||
|
||||
assert_text 'Ident 1234'
|
||||
assert_text 'Email john@inbox.test'
|
||||
assert_text 'Phone +555.555'
|
||||
|
||||
assert_text "Created at #{l Time.zone.parse('2010-07-05')}"
|
||||
assert_text "Updated at #{l Time.zone.parse('2010-07-06')}"
|
||||
end
|
||||
end
|
58
test/system/registrant_area/domains/details_test.rb
Normal file
58
test/system/registrant_area/domains/details_test.rb
Normal file
|
@ -0,0 +1,58 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrantAreaDomainDetailsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:registrant)
|
||||
@domain = domains(:shop)
|
||||
|
||||
Setting.days_to_keep_business_registry_cache = 1
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
end
|
||||
|
||||
def test_general_data
|
||||
visit registrant_domain_url(@domain)
|
||||
assert_text 'Name shop.test'
|
||||
assert_text "Registered at #{l Time.zone.parse('2010-07-04')}"
|
||||
assert_link 'Best Names', href: registrant_registrar_path(@domain.registrar)
|
||||
|
||||
assert_text 'Transfer code'
|
||||
assert_css('[value="65078d5"]')
|
||||
|
||||
assert_text "Valid to #{l Time.zone.parse('2010-07-05')}"
|
||||
assert_text "Outzone at #{l Time.zone.parse('2010-07-06')}"
|
||||
assert_text "Delete at #{l Time.zone.parse('2010-07-07')}"
|
||||
assert_text "Force delete at #{l Time.zone.parse('2010-07-08')}"
|
||||
end
|
||||
|
||||
def test_registrant
|
||||
visit registrant_domain_url(@domain)
|
||||
assert_text 'Name John'
|
||||
assert_text 'Code john-001'
|
||||
assert_text 'Ident 1234'
|
||||
assert_text 'Email john@inbox.test'
|
||||
assert_text 'Phone +555.555'
|
||||
assert_link 'View details', href: registrant_domain_contact_path(@domain, @domain.registrant)
|
||||
end
|
||||
|
||||
def test_admin_contacts
|
||||
visit registrant_domain_url(@domain)
|
||||
|
||||
within('.admin-domain-contacts') do
|
||||
assert_link 'Jane', href: registrant_domain_contact_path(@domain, contacts(:jane))
|
||||
assert_text 'jane-001'
|
||||
assert_text 'jane@mail.test'
|
||||
assert_css '.admin-domain-contact', count: 1
|
||||
end
|
||||
end
|
||||
|
||||
def test_tech_contacts
|
||||
visit registrant_domain_url(@domain)
|
||||
|
||||
within('.tech-domain-contacts') do
|
||||
assert_link 'William', href: registrant_domain_contact_path(@domain, contacts(:william))
|
||||
assert_text 'william-001'
|
||||
assert_text 'william@inbox.test'
|
||||
assert_css '.tech-domain-contact', count: 2
|
||||
end
|
||||
end
|
||||
end
|
20
test/system/registrant_area/domains/list_test.rb
Normal file
20
test/system/registrant_area/domains/list_test.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrantAreaDomainListTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:registrant)
|
||||
@domain = domains(:shop)
|
||||
|
||||
Setting.days_to_keep_business_registry_cache = 1
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
end
|
||||
|
||||
def test_show_domain_list
|
||||
visit registrant_domains_url
|
||||
assert_link 'shop.test', href: registrant_domain_path(@domain)
|
||||
assert_link 'John', href: registrant_domain_contact_path(@domain, @domain.registrant)
|
||||
assert_link 'Best Names', href: registrant_registrar_path(@domain.registrar)
|
||||
assert_text l(Time.zone.parse('2010-07-05'))
|
||||
assert_css '.domains .domain', count: 5
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue