Skip to content

Commit

Permalink
Add spec to test R18n and Rails mailers
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Mar 4, 2012
1 parent f943320 commit 2ed4b2f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions r18n-rails/spec/app/app/mailers/test_mailer.rb
@@ -0,0 +1,7 @@
class TestMailer < ActionMailer::Base
default :from => 'from@example.com'

def test
mail(:to => 'to@example.com')
end
end
3 changes: 3 additions & 0 deletions r18n-rails/spec/app/app/views/test_mailer/test.text.erb
@@ -0,0 +1,3 @@
<%= r18n.user.name %>
<%= t 'user.name' %>
<%= t.user.name %>
5 changes: 5 additions & 0 deletions r18n-rails/spec/rails_spec.rb
Expand Up @@ -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.