FIX: Don't allow invalid email to be saved.

This commit is contained in:
Guo Xiang Tan
2016-12-21 17:00:45 +08:00
parent 5d7f3223f0
commit 13c6191e89
13 changed files with 97 additions and 18 deletions

View File

@@ -28,14 +28,5 @@ describe UserActivator do
expect(user.email_tokens.last.created_at).to be_within_one_second_of(Time.zone.now)
end
it "escapes the email in the message" do
user = Fabricate(:user, email: '<strike>eviltrout@example.com</strike>')
activator = EmailActivator.new(user, nil, nil, nil)
msg = activator.activate
expect(msg).to match(/eviltrout@example.com/)
expect(msg).not_to match(/<strike>/)
end
end
end