Commit a47ef5a4a07068556822cdbc4b383bba4670ad0a

Authored by Vasiliy Ermolovich
1 parent f42acdcd
Exists in master and in 1 other branch production

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 5 include EmailSpec::Helpers
6 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 11 it "should send the email" do
14 12 ActionMailer::Base.deliveries.size.should == 1
15 13 end
16 14  
17 15 it "should html-escape the notice's message for the html part" do
18   - @email.should have_body_text("class &lt; ActionController::Base")
  16 + email.should have_body_text("class &lt; ActionController::Base")
19 17 end
20 18  
21 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 21 end
24 22 end
25 23 end
... ...