Fix "Test is missing assertions" warnings

`test_set_null_fields_on_migrations`
      ./devise/test/models_test.rb:87
    `test_does_not_crash_when_the_last_request_at_is_a_String`
      ./devise/test/integration/timeoutable_test.rb:191
    `test_defined_Warden_after_authentication_callback_should_not_be_called_when_sign_in_is_called`
      ./devise/test/test/controller_helpers_test.rb:114
    `test_defined_Warden_before_logout_callback_should_not_be_called_when_sign_out_is_called`
      ./devise/test/test/controller_helpers_test.rb:128
This commit is contained in:
Carlos Antonio da Silva
2026-01-05 18:10:32 -03:00
parent 731074bf09
commit e9c534d363
3 changed files with 7 additions and 5 deletions

View File

@@ -191,7 +191,9 @@ class SessionTimeoutTest < Devise::IntegrationTest
test 'does not crash when the last_request_at is a String' do
user = sign_in_as_user
get edit_form_user_path(user, last_request_at: Time.now.utc.to_s)
get users_path
assert_nothing_raised do
get edit_form_user_path(user, last_request_at: Time.now.utc.to_s)
get users_path
end
end
end

View File

@@ -90,7 +90,7 @@ class ActiveRecordTest < ActiveSupport::TestCase
def send_devise_notification(*); end
end
klass.create!
assert_nothing_raised { klass.create! }
end
end

View File

@@ -112,7 +112,7 @@ class TestControllerHelpersTest < Devise::ControllerTestCase
end
test "defined Warden after_authentication callback should not be called when sign_in is called" do
begin
assert_nothing_raised do
Warden::Manager.after_authentication do |user, auth, opts|
flunk "callback was called while it should not"
end
@@ -126,7 +126,7 @@ class TestControllerHelpersTest < Devise::ControllerTestCase
end
test "defined Warden before_logout callback should not be called when sign_out is called" do
begin
assert_nothing_raised do
Warden::Manager.before_logout do |user, auth, opts|
flunk "callback was called while it should not"
end