Sha256: 9bae49807d925e9abcb8b1e910f1de0d77f330473a5ee7665baa03b2646ceb58

Contents?: true

Size: 1.24 KB

Versions: 57

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

if rails_present?
  require 'action_view'
  require 'appsignal/aggregator/middleware/action_view_sanitizer'

  describe Appsignal::Aggregator::Middleware::ActionViewSanitizer do
    let(:klass) { Appsignal::Aggregator::Middleware::ActionViewSanitizer }
    let(:sanitizer) { klass.new }

    describe "#call" do
      before { Rails.root.stub(:to_s => '/var/www/app/20130101') }
      let(:event) do
        notification_event(
          :name => 'render_partial.action_view',
          :payload => create_payload(payload)
        )
      end
      let(:payload) do
        {
          :identifier => '/var/www/app/20130101/app/views/home/index/html.erb'
        }
      end
      subject { event.payload }
      before { sanitizer.call(event) { } }

      it "should strip Rails root from the path" do
        subject[:identifier].should == 'app/views/home/index/html.erb'
      end

      context "with a frozen identifier" do
        let(:payload) do
          {
            :identifier => '/var/www/app/20130101/app/views/home/index/html.erb'.freeze
          }
        end

        it "should strip Rails root from the path" do
          subject[:identifier].should == 'app/views/home/index/html.erb'
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
appsignal-0.11.18 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.17 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.16 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.15 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.14 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.14.beta.1 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.13 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.13.beta.4 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.13.beta.3 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.13.beta.2 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.13.beta.1 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.13.beta.0 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.12 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.11 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.10 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.10.beta.2 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.10.beta.1 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.9 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.8.beta.4 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb
appsignal-0.11.8.beta.3 spec/lib/appsignal/aggregator/middleware/action_view_sanitizer_spec.rb