Sha256: 56d1fa78f3259cf2414ec2c87200fddb906cab02818b74ccae2612fb1fc64b74

Contents?: true

Size: 1.62 KB

Versions: 4

Compression:

Stored size: 1.62 KB

Contents

Feature: Use the notifier in a plain Rack app

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

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

      ProjectlockerErrata.configure do |config|
        config.api_key = 'my_api_key'
        config.logger = Logger.new STDOUT
      end

      app = Rack::Builder.app do
        use ProjectlockerErrata::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 ProjectlockerErrata notification

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

      ProjectlockerErrata.configure do |config|
        config.api_key = 'my_api_key'
        config.ignore_user_agent << /ignore/
        config.logger = Logger.new STDOUT
      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 ProjectlockerErrata::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 "** [ProjectlockerErrata] Response from ProjectlockerErrata:"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
projectlocker_errata-0.1.1 features/rack.feature
projectlocker_errata-0.1.0 features/rack.feature
projectlocker_errata-0.0.2 features/rack.feature
projectlocker_errata-0.0.1 features/rack.feature