Sha256: 97628d79fdc6b5d3aaaf69ab9736fff8c9edc6282575efa2bc3d3d937c079ff3

Contents?: true

Size: 482 Bytes

Versions: 5

Compression:

Stored size: 482 Bytes

Contents

require_relative '../../test_helper'
require 'rack'
require 'logster/redis_store'
require 'logster/middleware/reporter'


class TestReporter < Minitest::Test

  def test_logs_errors
    Logster.store = Logster::TestStore.new

    reporter = Logster::Middleware::Reporter.new(nil)
    env = Rack::MockRequest.env_for("/logs/report_js_error?message=hello")
    status, = reporter.call(env)

    assert_equal(200, status)
    assert_equal(1, Logster.store.reported.length)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
logster-0.1.0 test/logster/middleware/test_reporter.rb
logster-0.0.13 test/logster/middleware/test_reporter.rb
logster-0.0.12 test/logster/middleware/test_reporter.rb
logster-0.0.11 test/logster/middleware/test_reporter.rb
logster-0.0.10 test/logster/middleware/test_reporter.rb