Permalink
Browse files

Add spec to test R18n and Rails mailers

  • Loading branch information...
ai committed Mar 4, 2012
1 parent f943320 commit 2ed4b2ff961739df0b40a1822dd50c8907c42618
@@ -0,0 +1,7 @@
+class TestMailer < ActionMailer::Base
+ default :from => 'from@example.com'
+
+ def test
+ mail(:to => 'to@example.com')
+ end
+end
@@ -0,0 +1,3 @@
+<%= r18n.user.name %>
+<%= t 'user.name' %>
+<%= t.user.name %>
@@ -104,4 +104,9 @@
R18n.get.user.name.should == 'Name'
end
+ it "should translate mails" do
+ email = TestMailer.test.deliver
+ email.encoded.should =~ /Name\r\nName\r\nName\r\n$/
+ end
+
end

0 comments on commit 2ed4b2f

Please sign in to comment.