From 631da786c393f41280ced587a9ced3f3eaf7a4a0 Mon Sep 17 00:00:00 2001 From: Sergei Tsoganov Date: Thu, 29 Jun 2023 14:00:44 +0300 Subject: [PATCH] Corrected tests --- app/views/admin/registrars/index.html.erb | 4 ++-- test/system/admin_area/registrars_test.rb | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/admin/registrars/index.html.erb b/app/views/admin/registrars/index.html.erb index b9a5da336..ff69236d9 100644 --- a/app/views/admin/registrars/index.html.erb +++ b/app/views/admin/registrars/index.html.erb @@ -64,11 +64,11 @@ <% 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 %> diff --git a/test/system/admin_area/registrars_test.rb b/test/system/admin_area/registrars_test.rb index e88a24bdd..096618517 100644 --- a/test/system/admin_area/registrars_test.rb +++ b/test/system/admin_area/registrars_test.rb @@ -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