From 1eaaf0c5132c0ee771a9153a8750c281502b8cbf Mon Sep 17 00:00:00 2001 From: Abdulaba Date: Mon, 16 Sep 2024 14:45:19 -0300 Subject: [PATCH] Fix: email format --- lib/devise.rb | 3 ++- test/models/authenticatable_test.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/devise.rb b/lib/devise.rb index 3847e190c..0717a0c97 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -115,7 +115,8 @@ module Test # @ symbols or whitespaces in either the localpart or the domain, and that # there is a single @ symbol separating the localpart and the domain. mattr_accessor :email_regexp - @@email_regexp = /\A[^@\s]+@[^@\s]+\z/ + @@email_regexp = /\A[^@\s]+@[^@\s]+\.[^@\s]+\z/ + # Range validation for password length mattr_accessor :password_length diff --git a/test/models/authenticatable_test.rb b/test/models/authenticatable_test.rb index 4d58b1e49..43c85c1cc 100644 --- a/test/models/authenticatable_test.rb +++ b/test/models/authenticatable_test.rb @@ -18,6 +18,7 @@ class AuthenticatableTest < ActiveSupport::TestCase # config.strip_whitespace_keys = [:email] test 'find_or_initialize_with_errors uses parameter filter on find' do user = User.create!(email: "example@example.com", password: "1234567") + assert_equal user, User.find_or_initialize_with_errors([:email], { email: " EXAMPLE@example.com " }) end