Commit a47ef5a4a07068556822cdbc4b383bba4670ad0a
1 parent
f42acdcd
Exists in
master
and in
1 other branch
use let instead of iVars in mailer spec
Showing
1 changed file
with
4 additions
and
6 deletions
Show diff stats
spec/mailers/mailer_spec.rb
@@ -5,21 +5,19 @@ describe Mailer do | @@ -5,21 +5,19 @@ describe Mailer do | ||
5 | include EmailSpec::Helpers | 5 | include EmailSpec::Helpers |
6 | include EmailSpec::Matchers | 6 | include EmailSpec::Matchers |
7 | 7 | ||
8 | - before do | ||
9 | - @notice = Fabricate(:notice, :message => "class < ActionController::Base") | ||
10 | - @email = Mailer.err_notification(@notice).deliver | ||
11 | - end | 8 | + let(:notice) { Fabricate(:notice, :message => "class < ActionController::Base") } |
9 | + let!(:email) { Mailer.err_notification(notice).deliver } | ||
12 | 10 | ||
13 | it "should send the email" do | 11 | it "should send the email" do |
14 | ActionMailer::Base.deliveries.size.should == 1 | 12 | ActionMailer::Base.deliveries.size.should == 1 |
15 | end | 13 | end |
16 | 14 | ||
17 | it "should html-escape the notice's message for the html part" do | 15 | it "should html-escape the notice's message for the html part" do |
18 | - @email.should have_body_text("class < ActionController::Base") | 16 | + email.should have_body_text("class < ActionController::Base") |
19 | end | 17 | end |
20 | 18 | ||
21 | it "should have inline css" do | 19 | it "should have inline css" do |
22 | - @email.should have_body_text('<p class="backtrace" style="') | 20 | + email.should have_body_text('<p class="backtrace" style="') |
23 | end | 21 | end |
24 | end | 22 | end |
25 | end | 23 | end |