try to fix spec

This commit is contained in:
carlad 2016-07-25 15:54:26 +02:00
parent 7107f4378c
commit 5e798aca6f

View File

@ -1,5 +1,3 @@
require 'sentry-raven'
describe Travis::API::V3::ServiceIndex, set_app: true do
let(:headers) {{ }}
let(:path) { "/v3/repo/1/enable" }
@ -13,22 +11,12 @@ describe Travis::API::V3::ServiceIndex, set_app: true do
end
describe Travis::API::V3::Router, set_app: true do
class FixRaven < Struct.new(:app)
def call(env)
requested_at = env['requested_at']
env['requested_at'] = env['requested_at'].to_s if env.key?('requested_at')
app.call(env)
rescue Exception => e
env['requested_at'] = requested_at
raise e
end
end
include Rack::Test::Methods
class TestError < StandardError
end
class TestError < StandardError; end
before do
set_app Raven::Rack.new(FixRaven.new(app))
set_app Raven::Rack.new(app)
Travis.config.sentry.dsn = "test"
Travis::Api::App.setup_monitoring
end