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