test/devise_test.rb in devise-4.0.3 vs test/devise_test.rb in devise-4.1.0

- old
+ new

@@ -33,37 +33,10 @@ Devise.setup do |config| assert_equal Devise, config end end - test 'setup block warns about defaults changing' do - Devise.app_set_configs = Set.new - - ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /email_regexp/ } - ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /reconfirmable/ } - ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /sign_out_via/ } - ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /skip_session_storage/ } - ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /strip_whitespace_keys/ } - - Devise.setup do - end - end - - test 'setup block doest not warns when the change is explicit set' do - ActiveSupport::Deprecation.expects(:warn).never - - swap Devise, - email_regexp: /@/, - reconfirmable: false, - sign_out_via: :get, - skip_session_storage: [], - strip_whitespace_keys: [] do - Devise.setup do - end - end - end - test 'stores warden configuration' do assert_kind_of Devise::Delegator, Devise.warden_config.failure_app assert_equal :user, Devise.warden_config.default_scope end @@ -119,11 +92,11 @@ end assert_not Devise.secure_compare("size_1", "size_four") end test 'Devise.email_regexp should match valid email addresses' do - valid_emails = ["test@example.com", "jo@jo.co", "f4$_m@you.com", "testing.example@example.com.ua"] - non_valid_emails = ["rex", "test@go,com", "test user@example.com", "test_user@example server.com", "test_user@example.com."] + valid_emails = ["test@example.com", "jo@jo.co", "f4$_m@you.com", "testing.example@example.com.ua", "test@tt", "test@valid---domain.com"] + non_valid_emails = ["rex", "test user@example.com", "test_user@example server.com"] valid_emails.each do |email| assert_match Devise.email_regexp, email end non_valid_emails.each do |email|