Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added specs for inherit_views with ActionMailer::Base
(cherry-pick of 623a79a)
- Loading branch information
Showing
5 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper')) | ||
|
||
describe 'Mailer specs' do | ||
before :all do | ||
ActionMailer::Base.delivery_method = :test | ||
ActionMailer::Base.perform_deliveries = true | ||
end | ||
|
||
describe NormalMailer do | ||
before :each do | ||
NormalMailer.deliver_email | ||
@deliveries = ActionMailer::Base.deliveries | ||
end | ||
|
||
it "should deliver email" do | ||
@deliveries.size.should == 1 | ||
end | ||
|
||
it "should render email with partial" do | ||
@deliveries.first.body.should == "normal_mailer:email\nnormal_mailer:_partial" | ||
end | ||
end | ||
|
||
describe InheritingMailer do | ||
before :each do | ||
InheritingMailer.deliver_email | ||
@deliveries = ActionMailer::Base.deliveries | ||
end | ||
|
||
it "should deliver email" do | ||
@deliveries.size.should == 1 | ||
end | ||
|
||
it "should render email with inherited partial" do | ||
@deliveries.first.body.should == "inheriting_mailer:email\nnormal_mailer:_partial" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
inheriting_mailer:email | ||
<%= render 'partial' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
normal_mailer:_partial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
normal_mailer:email | ||
<%= render 'partial' %> |