mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +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>
|
||||||
<td>
|
<td>
|
||||||
<% if !x.accredited? || x.accreditation_expired? %>
|
<% 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},
|
{ controller: 'registrars', action: 'set_test_date', registrar_id: x.id},
|
||||||
{ method: :post, class: 'btn btn-primary'} %>
|
{ method: :post, class: 'btn btn-primary'} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= button_to t('.remove_test_btn'),
|
<%= button_to t(:remove_test_btn),
|
||||||
{ controller: 'registrars', action: 'remove_test_date', registrar_id: x.id},
|
{ controller: 'registrars', action: 'remove_test_date', registrar_id: x.id},
|
||||||
{ method: :post, class: 'btn btn-danger'} %>
|
{ method: :post, class: 'btn btn-danger'} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -106,7 +106,7 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
|
||||||
|
|
||||||
api_user = @registrar.api_users.first
|
api_user = @registrar.api_users.first
|
||||||
api_user.accreditation_date = date
|
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
|
api_user.save
|
||||||
|
|
||||||
visit admin_registrars_path
|
visit admin_registrars_path
|
||||||
|
@ -117,10 +117,11 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
|
||||||
def test_should_not_display_remove_test_if_accreditation_date_is_expired
|
def test_should_not_display_remove_test_if_accreditation_date_is_expired
|
||||||
date = Time.zone.now - 1.year - 10.minutes
|
date = Time.zone.now - 1.year - 10.minutes
|
||||||
|
|
||||||
api_user = @registrar.api_users.first
|
@registrar.api_users.each do |api_user|
|
||||||
api_user.accreditation_date = date
|
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
|
api_user.save
|
||||||
|
end
|
||||||
|
|
||||||
visit admin_registrars_path
|
visit admin_registrars_path
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue