From 8cedcdc3039a8decdc34a66c1976a6aaee0d0ca9 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Wed, 31 Aug 2011 11:01:41 +0800 Subject: [PATCH] Extracted test setup into a before block --- spec/views/notices/_backtrace.html.haml_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/views/notices/_backtrace.html.haml_spec.rb b/spec/views/notices/_backtrace.html.haml_spec.rb index 6db6826..d162336 100644 --- a/spec/views/notices/_backtrace.html.haml_spec.rb +++ b/spec/views/notices/_backtrace.html.haml_spec.rb @@ -2,13 +2,16 @@ require 'spec_helper' describe "notices/_backtrace.html.haml" do describe 'missing file in backtrace' do - it "should replace nil file with [unknown source]" do + before do notice = Factory(:notice, :backtrace => [{ 'number' => rand(999), 'file' => nil, 'method' => ActiveSupport.methods.shuffle.first }]) assign :app, notice.err.app + end + + it "should replace nil file with [unknown source]" do render :partial => "notices/backtrace", :locals => {:lines => notice.backtrace} rendered.should match(/\[unknown source\]/) end -- libgit2 0.21.2