diff --git a/spec/views/notices/_backtrace.html.haml_spec.rb b/spec/views/notices/_backtrace.html.haml_spec.rb
index 43c1ce2..07dca60 100644
--- a/spec/views/notices/_backtrace.html.haml_spec.rb
+++ b/spec/views/notices/_backtrace.html.haml_spec.rb
@@ -2,17 +2,15 @@ require 'spec_helper'
describe "notices/_backtrace.html.haml" do
describe 'missing file in backtrace' do
- before do
- @notice = Fabricate(:notice, :backtrace => [{
- 'number' => rand(999),
- 'file' => nil,
- 'method' => ActiveSupport.methods.shuffle.first
- }])
- assign :app, @notice.err.app
+ let(:notice) do
+ backtrace = { 'number' => rand(999), 'file' => nil, 'method' => ActiveSupport.methods.shuffle.first }
+ Fabricate(:notice, :backtrace => [backtrace])
end
it "should replace nil file with [unknown source]" do
- render "notices/backtrace", :lines => @notice.backtrace
+ assign :app, notice.err.app
+
+ render "notices/backtrace", :lines => notice.backtrace
rendered.should match(/\[unknown source\]/)
end
end
--
libgit2 0.21.2