test/integration/authenticatable_test.rb in devise-4.4.1 vs test/integration/authenticatable_test.rb in devise-4.4.2
- old
+ new
@@ -1,10 +1,16 @@
# frozen_string_literal: true
require 'test_helper'
class AuthenticationSanityTest < Devise::IntegrationTest
+ test 'sign in should not run model validations' do
+ sign_in_as_user
+
+ refute User.validations_performed
+ end
+
test 'home should be accessible without sign in' do
visit '/'
assert_response :success
assert_template 'home/index'
end
@@ -541,21 +547,9 @@
swap Devise, navigational_formats: ['*/*', :html] do
sign_in_as_user
delete destroy_user_session_path, xhr: true, headers: { "HTTP_ACCEPT" => "text/html,*/*" }
assert_response :redirect
refute warden.authenticated?(:user)
- end
- end
-
- test 'not signed in should return notification payload with 401 status' do
- begin
- subscriber = ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |_name, _start, _finish, _id, payload|
- assert_equal 401, payload[:status]
- end
-
- get admins_path
- ensure
- ActiveSupport::Notifications.unsubscribe(subscriber)
end
end
end
class AuthenticationKeysTest < Devise::IntegrationTest