Sha256: 082bc6199a7c0189acc1ec155162eda25e50fd04fe0085f277e33acfc3c8bc8b

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

Feature: Use the notifier in a plain Rack app

  Background:
    Given I have built and installed the "airbrake" gem

  Scenario: Rescue and exception in a Rack app
    Given the following Rack app:
      """
      require 'rack'
      require 'airbrake'

      Airbrake.configure do |config|
        config.api_key = 'my_api_key'
      end

      app = Rack::Builder.app do
        use Airbrake::Rack
        run lambda { |env| raise "Rack down" }
      end
      """
    When I perform a Rack request to "http://example.com:123/test/index?param=value"
    Then I should receive a Airbrake notification

  Scenario: Ignore user agents
    Given the following Rack app:
      """
      require 'rack'
      require 'airbrake'

      Airbrake.configure do |config|
        config.api_key = 'my_api_key'
        config.ignore_user_agent << /ignore/
      end

      class Mock
        class AppendUserAgent
          def initialize(app)
            @app = app
          end

          def call(env)
            env["HTTP_USER_AGENT"] = "ignore"
            @app.call(env)
          end
        end
      end

      app = Rack::Builder.app do
        use Airbrake::Rack
        use Mock::AppendUserAgent
        run lambda { |env| raise "Rack down" }
      end
      """
    When I perform a Rack request to "http://example.com:123/test/index?param=value"
    Then I should not see "** [Airbrake] Response from Airbrake:"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
airbrake-3.1.2 features/rack.feature