Sha256: 9f7004bb97b5e02df21401f3e063c4a46571f4267ee97a9837cdbb996232766d

Contents?: true

Size: 1.46 KB

Versions: 16

Compression:

Stored size: 1.46 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

if NewRelic::Agent::Instrumentation::RackHelpers.rack_version_supported?

require File.join(File.dirname(__FILE__), 'example_app')
require 'new_relic/rack/browser_monitoring'
require 'new_relic/rack/agent_hooks'
require 'new_relic/rack/error_collector'

class RackCascadeTest < Minitest::Test
  include MultiverseHelpers

  setup_and_teardown_agent(
    :beacon                 => 'beacon',
    :browser_key            => 'browserKey',
    :js_agent_loader        => 'loader',
    :application_id         => '5',
    :'rum.enabled'          => true,
    :license_key            => 'a' * 40
  )

  include Rack::Test::Methods

  def app
    Rack::Builder.app do
      use NewRelic::Rack::AgentHooks
      use NewRelic::Rack::BrowserMonitoring
      use ResponseCodeMiddleware
      run Rack::Cascade.new([FirstCascadeExampleApp.new, SecondCascadeExampleApp.new])
    end
  end

  def test_insert_js_does_not_fire_for_rack_cascade_404_responses
    rsp = get '/', { 'body' => '<html><head></head><body></body></html>', 'override-response-code' => 404 }
    refute(rsp.body.include?('script'), "\nExpected\n---\n#{rsp.body}\n---\nnot to include 'script'.")
  end

  def test_rack_cascade_transactions_are_named_for_the_last_app
    rsp = get '/cascade'
    assert_metrics_recorded('Controller/SecondCascadeExampleApp/call')
  end
end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
newrelic_rpm-3.18.1.330 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.18.0.329 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.17.2.327 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.17.1.326 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.17.0.325 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.16.3.323 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.16.2.321 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.16.1.320 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.16.0.318 test/multiverse/suites/rack/rack_cascade_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.15.2.317 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.15.1.316 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.15.0.314 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.14.3.313 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.14.2.312 test/multiverse/suites/rack/rack_cascade_test.rb
newrelic_rpm-3.14.1.311 test/multiverse/suites/rack/rack_cascade_test.rb