mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 06:56:23 +02:00
Corrected tests
This commit is contained in:
parent
58d32c7500
commit
631da786c3
2 changed files with 8 additions and 7 deletions
|
@ -64,11 +64,11 @@
|
|||
</td>
|
||||
<td>
|
||||
<% if !x.accredited? || x.accreditation_expired? %>
|
||||
<%= button_to t('.set_test_btn'),
|
||||
<%= button_to t(:set_test_btn),
|
||||
{ controller: 'registrars', action: 'set_test_date', registrar_id: x.id},
|
||||
{ method: :post, class: 'btn btn-primary'} %>
|
||||
<% else %>
|
||||
<%= button_to t('.remove_test_btn'),
|
||||
<%= button_to t(:remove_test_btn),
|
||||
{ controller: 'registrars', action: 'remove_test_date', registrar_id: x.id},
|
||||
{ method: :post, class: 'btn btn-danger'} %>
|
||||
<% end %>
|
||||
|
|
|
@ -106,7 +106,7 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
|
|||
|
||||
api_user = @registrar.api_users.first
|
||||
api_user.accreditation_date = date
|
||||
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||
api_user.accreditation_expire_date = date + 1.year
|
||||
api_user.save
|
||||
|
||||
visit admin_registrars_path
|
||||
|
@ -117,10 +117,11 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
|
|||
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
|
||||
@registrar.api_users.each do |api_user|
|
||||
api_user.accreditation_date = date
|
||||
api_user.accreditation_expire_date = date + 1.year
|
||||
api_user.save
|
||||
end
|
||||
|
||||
visit admin_registrars_path
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue