Commit 1bdc92f9b6a1215e85cc3a1bc1b527c0417a2e36

Authored by Nathan Broadbent
1 parent 6cb52119
Exists in master and in 1 other branch production

Fixed notices/backtrace spec. Need to set instance variables in a before block.

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