aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-04-08 07:31:07 +0000
committerfrancis <francis>2009-04-08 07:31:07 +0000
commit0960200802d7c87940cd0c7348d2f612c4f15d65 (patch)
tree9ed72928a3759b4a7e0d0cebb1710f6a8a7d2e9c /spec/models/user_spec.rb
parent2424bdf7da5346a6bf28dbaf9ff4d9bfd70b070c (diff)
TMail rebuilds address when constructing emails. Move our more
aggressive quoting rule into a TMail monkey patch proper so it is always called when constructing emails, and remove the hacky function (Address.encode_quoted_string) it used to call in special places
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index dc14feff9..46aa046fb 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -124,3 +124,23 @@ describe User, 'when asked if a user owns every request' do
end
end
+
+describe User, " when making name and email address" do
+ it "should generate a name and email" do
+ @user = User.new
+ @user.name = "Sensible User"
+ @user.email = "sensible@localhost"
+
+ @user.name_and_email.should == "Sensible User <sensible@localhost>"
+ end
+
+ it "should quote name and email with funny characters in the name" do
+ @user = User.new
+ @user.name = "Silly @ User"
+ @user.email = "silly@localhost"
+
+ @user.name_and_email.should == "\"Silly @ User\" <silly@localhost>"
+ end
+end
+
+