mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
Refactor registrars
- Reorganize views - Improve database structure - Use default translations - Combine tests
This commit is contained in:
parent
59e9b16dfa
commit
efb63399b2
27 changed files with 287 additions and 353 deletions
|
@ -4,6 +4,8 @@ class ContactVersionsTest < ApplicationSystemTestCase
|
|||
def setup
|
||||
super
|
||||
|
||||
@registrar = registrars(:bestnames)
|
||||
|
||||
create_contact_with_history
|
||||
sign_in users(:admin)
|
||||
end
|
||||
|
@ -16,18 +18,13 @@ class ContactVersionsTest < ApplicationSystemTestCase
|
|||
|
||||
def create_contact_with_history
|
||||
sql = <<-SQL.squish
|
||||
INSERT INTO registrars (id, name, reg_no, email, country_code, code,
|
||||
accounting_customer_code, language, reference_no)
|
||||
VALUES (75, 'test_registrar', 'test123', 'test@test.com', 'EE', 'TEST123',
|
||||
'test123', 'en', '1234');
|
||||
|
||||
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
|
||||
VALUES (75, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', 75);
|
||||
VALUES (75, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', #{@registrar.id});
|
||||
|
||||
INSERT INTO log_contacts (item_type, item_id, event, whodunnit, object,
|
||||
object_changes, created_at, session, children, ident_updated_at, uuid)
|
||||
VALUES ('Contact', 75, 'update', '1-AdminUser',
|
||||
'{"id": 75, "code": "test_code", "auth_info": "8b4d462aa04194ca78840a", "registrar_id": 75, "old_field": "value"}',
|
||||
'{"id": 75, "code": "test_code", "auth_info": "8b4d462aa04194ca78840a", "registrar_id": #{@registrar.id}, "old_field": "value"}',
|
||||
'{"other_made_up_field": "value"}',
|
||||
'2018-04-23 15:50:48.113491', '2018-04-23 12:44:56',
|
||||
'{"legal_documents":[null]}', null, null
|
||||
|
@ -42,16 +39,20 @@ class ContactVersionsTest < ApplicationSystemTestCase
|
|||
end
|
||||
|
||||
def test_removed_fields_are_not_causing_errors_in_index_view
|
||||
assert_equal 'Best Names', @registrar.name
|
||||
|
||||
visit admin_contact_versions_path
|
||||
assert_text 'test_registrar'
|
||||
assert_text 'Best Names'
|
||||
assert_text 'update 23.04.18, 18:50'
|
||||
end
|
||||
|
||||
def test_removed_fields_are_not_causing_errors_in_details_view
|
||||
assert_equal 'Best Names', @registrar.name
|
||||
|
||||
version_id = Contact.find(75).versions.last
|
||||
visit admin_contact_version_path(version_id)
|
||||
|
||||
assert_text 'test_registrar'
|
||||
assert_text 'Best Names'
|
||||
assert_text '23.04.18, 18:50 update 1-AdminUser'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue