From a47ef5a4a07068556822cdbc4b383bba4670ad0a Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Sun, 10 Jun 2012 15:16:32 +0300 Subject: [PATCH] use let instead of iVars in mailer spec --- spec/mailers/mailer_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/mailers/mailer_spec.rb b/spec/mailers/mailer_spec.rb index e3bd455..f6cc4ad 100644 --- a/spec/mailers/mailer_spec.rb +++ b/spec/mailers/mailer_spec.rb @@ -5,21 +5,19 @@ describe Mailer do include EmailSpec::Helpers include EmailSpec::Matchers - before do - @notice = Fabricate(:notice, :message => "class < ActionController::Base") - @email = Mailer.err_notification(@notice).deliver - end + let(:notice) { Fabricate(:notice, :message => "class < ActionController::Base") } + let!(:email) { Mailer.err_notification(notice).deliver } it "should send the email" do ActionMailer::Base.deliveries.size.should == 1 end it "should html-escape the notice's message for the html part" do - @email.should have_body_text("class < ActionController::Base") + email.should have_body_text("class < ActionController::Base") end it "should have inline css" do - @email.should have_body_text('