diff --git a/test/fixtures/contacts.yml b/test/fixtures/contacts.yml index 1f2e4b8da..4ae02105e 100644 --- a/test/fixtures/contacts.yml +++ b/test/fixtures/contacts.yml @@ -9,6 +9,8 @@ john: code: john-001 auth_info: cacb5b uuid: eb2f2766-b44c-4e14-9f16-32ab1a7cb957 + created_at: <%= Time.zone.parse('2010-07-05').to_s(:db) %> + updated_at: <%= Time.zone.parse('2010-07-06').to_s(:db) %> william: &william name: William diff --git a/test/fixtures/domains.yml b/test/fixtures/domains.yml index 4d6468c92..5c4744e49 100644 --- a/test/fixtures/domains.yml +++ b/test/fixtures/domains.yml @@ -4,7 +4,11 @@ shop: registrar: bestnames registrant: john transfer_code: 65078d5 - valid_to: 2010-07-05 + registered_at: <%= Time.zone.parse('2010-07-04').to_s(:db) %> + valid_to: <%= Time.zone.parse('2010-07-05').to_s(:db) %> + outzone_at: <%= Time.zone.parse('2010-07-06').to_s(:db) %> + delete_at: <%= Time.zone.parse('2010-07-07').to_s(:db) %> + force_delete_at: <%= Time.zone.parse('2010-07-08').to_s(:db) %> period: 1 period_unit: m uuid: 1b3ee442-e8fe-4922-9492-8fcb9dccc69c diff --git a/test/system/registrant_area/contacts/details_test.rb b/test/system/registrant_area/contacts/details_test.rb new file mode 100644 index 000000000..0f728a511 --- /dev/null +++ b/test/system/registrant_area/contacts/details_test.rb @@ -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 \ No newline at end of file diff --git a/test/system/registrant_area/domains/details_test.rb b/test/system/registrant_area/domains/details_test.rb new file mode 100644 index 000000000..57765844a --- /dev/null +++ b/test/system/registrant_area/domains/details_test.rb @@ -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 \ No newline at end of file diff --git a/test/system/registrant_area/domains/list_test.rb b/test/system/registrant_area/domains/list_test.rb new file mode 100644 index 000000000..6f2ddddff --- /dev/null +++ b/test/system/registrant_area/domains/list_test.rb @@ -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 \ No newline at end of file