Sha256: 685405abe837512cd7f5485c74b49a80cb464e6c8f46c76604f7fd85e01db8ce

Contents?: true

Size: 1.26 KB

Versions: 8

Compression:

Stored size: 1.26 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.

require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper.rb')

# Shhhh
Padrino::Logger::Config[:development][:stream] = :null

class PadrinoTestApp < Padrino::Application

  register Padrino::Rendering
  register Padrino::Helpers

  get '/user/login' do
    "please log in"
  end

  get /\/regex.*/ do
    "with extra regex's please!"
  end
end

class PadrinoRoutesTest < Test::Unit::TestCase
  include Rack::Test::Methods

  def app
    PadrinoTestApp
  end

  def setup
    ::NewRelic::Agent.manual_start
  end

  def test_basic_route
    get '/user/login'
    assert_equal 200, last_response.status
    assert_equal 'please log in', last_response.body

    assert_metrics_recorded([
        "Controller/Sinatra/PadrinoTestApp/GET user/login",
        "Apdex/Sinatra/PadrinoTestApp/GET user/login"])
  end

  def test_regex_route
    get '/regexes'
    assert_equal 200, last_response.status
    assert_equal "with extra regex's please!", last_response.body

    assert_metrics_recorded([
        "Controller/Sinatra/PadrinoTestApp/GET regex.*",
        "Apdex/Sinatra/PadrinoTestApp/GET regex.*"])
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.5.130 test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.4.122 test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.4.113.beta test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.3.111 test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.3.106 test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.3.105.beta test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.3.104 test/multiverse/suites/padrino/padrino_test.rb
newrelic_rpm-3.6.3.103.beta test/multiverse/suites/padrino/padrino_test.rb