1 14 end
With that change it's easy to test the initialize_defaults-method (as shown here using rspec):
1 describe ActionMailer::Localized do
2
3 before(:each) do
4 @localized_mailer = Class.new(ActionMailer::Localized) do
5 ; end
6 end.new
7 @localized_mailer.stub!(:render)
8 I18n.locale = 'de'
9 end
10
11 describe 'after being initialized' do
12 before(:each) do
13 @localized_mailer.create!('mailer_method', Object.new)
14 end
15 it "should have the localized template name set" do
16 @localized_mailer.template.should == 'de_mailer_method'
17 end
18 end
19
20 end

0 comments:
Post a Comment