Se the new default for skip_session_storage config

This commit is contained in:
Ulisses Almeida
2016-04-26 18:11:54 -03:00
parent 6e419ce821
commit 896521be73
3 changed files with 13 additions and 26 deletions

View File

@@ -39,7 +39,6 @@ class DeviseTest < ActiveSupport::TestCase
Devise.app_set_configs = Set.new
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /sign_out_via/ }
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /skip_session_storage/ }
Devise.setup do
end
@@ -48,11 +47,9 @@ class DeviseTest < ActiveSupport::TestCase
test 'setup block doest not warns when the change is explicit set' do
ActiveSupport::Deprecation.expects(:warn).never
swap Devise,
sign_out_via: :get,
skip_session_storage: [] do
Devise.setup do
end
swap Devise, sign_out_via: :get do
Devise.setup do
end
end
end

View File

@@ -11,13 +11,15 @@ class HttpAuthenticationTest < Devise::IntegrationTest
end
test 'sign in should authenticate with http' do
sign_in_as_new_user_with_http
assert_response 200
assert_match '<email>user@test.com</email>', response.body
assert warden.authenticated?(:user)
swap Devise, skip_session_storage: [] do
sign_in_as_new_user_with_http
assert_response 200
assert_match '<email>user@test.com</email>', response.body
assert warden.authenticated?(:user)
get users_path(format: :xml)
assert_response 200
get users_path(format: :xml)
assert_response 200
end
end
test 'sign in should authenticate with http but not emit a cookie if skipping session storage' do