Commit 8cedcdc3039a8decdc34a66c1976a6aaee0d0ca9

Authored by Nathan Broadbent
1 parent 1480a66f
Exists in master and in 1 other branch production

Extracted test setup into a before block

spec/views/notices/_backtrace.html.haml_spec.rb
... ... @@ -2,13 +2,16 @@ require 'spec_helper'
2 2  
3 3 describe "notices/_backtrace.html.haml" do
4 4 describe 'missing file in backtrace' do
5   - it "should replace nil file with [unknown source]" do
  5 + before do
6 6 notice = Factory(:notice, :backtrace => [{
7 7 'number' => rand(999),
8 8 'file' => nil,
9 9 'method' => ActiveSupport.methods.shuffle.first
10 10 }])
11 11 assign :app, notice.err.app
  12 + end
  13 +
  14 + it "should replace nil file with [unknown source]" do
12 15 render :partial => "notices/backtrace", :locals => {:lines => notice.backtrace}
13 16 rendered.should match(/\[unknown source\]/)
14 17 end
... ...