Sha256: daac501abbe7a4313f4f2fa11ec436093d217aeacf780d124241a96dfddfcc89

Contents?: true

Size: 912 Bytes

Versions: 4

Compression:

Stored size: 912 Bytes

Contents

require "minitest_helper"
require File.expand_path(File.dirname(__FILE__) + '/apps/sinatra_simple')

describe Sinatra do
  before do
    clear_all_traces
  end

  it "should trace a request to a simple sinatra stack" do
    @app = SinatraSimple

    r = get "/render"

    traces = get_all_traces

    traces.count.must_equal 9
    valid_edges?(traces).must_equal true
    validate_outer_layers(traces, 'rack')

    traces[2]['Layer'].must_equal "sinatra"
    traces[4]['Label'].must_equal "profile_entry"
    traces[7]['Controller'].must_equal "SinatraSimple"
    traces[8]['Label'].must_equal "exit"

    # Validate the existence of the response header
    r.headers.key?('X-Trace').must_equal true
    r.headers['X-Trace'].must_equal traces[8]['X-Trace']
  end

  it "should have RUM code in the response" do
    @app = SinatraSimple

    r = get "/render"

    (r.body =~ /tly.js/).wont_equal nil
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
traceview-3.0.2-java test/frameworks/sinatra_test.rb
traceview-3.0.2 test/frameworks/sinatra_test.rb
traceview-3.0.1-java test/frameworks/sinatra_test.rb
traceview-3.0.1 test/frameworks/sinatra_test.rb