Commit 416c15a2275d1cf30eee2bdadd451120e80cd838

Authored by Sergey Kuznetsov
1 parent 5a59cc4f
Exists in master and in 1 other branch production

Fixed BacktraceLine::IN_APP_PATH regexp issue

app/models/backtrace_line.rb
1 1 class BacktraceLine
2 2 include Mongoid::Document
3   - IN_APP_PATH = %r{^\[PROJECT_ROOT\]\/(?!(vendor))}
  3 + IN_APP_PATH = %r{^\[PROJECT_ROOT\](?!(\/vendor))}
4 4 GEMS_PATH = %r{\[GEM_ROOT\]\/gems\/([^\/]+)}
5 5  
6 6 field :number, :type => Integer
... ...
spec/models/backtrace_line.rb 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +require 'spec_helper'
  2 +
  3 +describe BacktraceLine do
  4 + subject { described_class.new(raw_line) }
  5 +
  6 + describe "root at the start of decorated filename" do
  7 + let(:raw_line) { { 'number' => rand(999), 'file' => '[PROJECT_ROOT]/app/controllers/pages_controller.rb', 'method' => ActiveSupport.methods.shuffle.first.to_s } }
  8 + it "should leave leading root symbol in filepath" do
  9 + subject.decorated_path.should == '/app/controllers/'
  10 + end
  11 + end
  12 +end
... ...