mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 14:06:21 +02:00
added new tests
This commit is contained in:
parent
97876ab1c1
commit
4567e56457
5 changed files with 159 additions and 3 deletions
|
@ -93,4 +93,70 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
|
|||
assert_text 'Language English'
|
||||
assert_text 'billing@bestnames.test'
|
||||
end
|
||||
|
||||
def test_should_display_btn_for_set_test_date
|
||||
visit admin_registrars_path
|
||||
|
||||
assert_button 'Set Test'
|
||||
assert_no_button 'Remove Test'
|
||||
end
|
||||
|
||||
def test_should_display_remove_test_if_there_accreditated_registrars
|
||||
date = Time.zone.now - 10.minutes
|
||||
|
||||
api_user = @registrar.api_users.first
|
||||
api_user.accreditation_date = date
|
||||
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||
api_user.save
|
||||
|
||||
visit admin_registrars_path
|
||||
|
||||
assert_button 'Remove Test'
|
||||
end
|
||||
|
||||
def test_should_not_display_remove_test_if_accreditation_date_is_expired
|
||||
date = Time.zone.now - 1.year - 10.minutes
|
||||
|
||||
api_user = @registrar.api_users.first
|
||||
api_user.accreditation_date = date
|
||||
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||
api_user.save
|
||||
|
||||
visit admin_registrars_path
|
||||
|
||||
assert_no_button 'Remove'
|
||||
end
|
||||
|
||||
def test_should_display_tests_button_in_registrar_deftails
|
||||
visit admin_registrar_path(@registrar)
|
||||
|
||||
assert_button 'Set Test'
|
||||
assert_no_button 'Remove Test'
|
||||
end
|
||||
|
||||
def test_should_display_remove_test_if_there_accreditated_registrars_in_registrar_details
|
||||
date = Time.zone.now - 10.minutes
|
||||
|
||||
api_user = @registrar.api_users.first
|
||||
api_user.accreditation_date = date
|
||||
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||
api_user.save
|
||||
|
||||
visit admin_registrar_path(@registrar)
|
||||
|
||||
assert_button 'Remove Test'
|
||||
end
|
||||
|
||||
def test_should_not_display_remove_test_if_accreditation_date_is_expired_in_registrar_details
|
||||
date = Time.zone.now - 1.year - 10.minutes
|
||||
|
||||
api_user = @registrar.api_users.first
|
||||
api_user.accreditation_date = date
|
||||
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||
api_user.save
|
||||
|
||||
visit admin_registrar_path(@registrar)
|
||||
|
||||
assert_no_button 'Remove'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue