I have the following regex expression to validate emails VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
I have also the following test function
test "valid signup information" do
get signup_path
assert_difference 'User.count', 1 do
post users_path, params: { user: { first_name: "John",
last_name: "Doe",
email: "[email protected]",
password: "foobar123",
password_confirmation: "foobar123" } }
end
follow_redirect!
assert_template 'users/show'
assert is_logged_in?
end
Yet, the test fails only when the email is set to [email protected]
Every single other mail of the same format works. I can't see why.
Moreover, when I try to manually sign up, the [email protected] address works perfectly fine.
Here's the log message when testing with [email protected]
Running via Spring preloader in process 5405
Started with run options --seed 28654
FAIL["test_valid_signup_information", UsersSignupTest, 1.127243652001198]
test_valid_signup_information#UsersSignupTest (1.13s)
"User.count" didn't change by 1.
Expected: 2
Actual: 1
test/integration/users_signup_test.rb:19:in `block in <class:UsersSignupTest>'
20/20: [=============================================================================================================================================================] 100% Time: 00:00:01, Time: 00:00:01
Finished in 1.14680s
Thanks,