Sha256: 1e191080980d6a46282ee9f2eb31f7775cef63371d28aace134302a0cc21fdc8
Contents?: true
Size: 958 Bytes
Versions: 18
Compression:
Stored size: 958 Bytes
Contents
require 'spec_helper' require 'sham_rack' describe Honeybadger::UserInformer do it 'modifies output if there is a honeybadger id' do main_app = lambda do |env| env['honeybadger.error_id'] = 1 [200, {}, ["<!-- HONEYBADGER ERROR -->"]] end informer_app = Honeybadger::UserInformer.new(main_app) ShamRack.mount(informer_app, "example.com") response = Net::HTTP.get_response(URI.parse("http://example.com/")) expect(response.body).to eq 'Honeybadger Error 1' expect(response["Content-Length"].to_i).to eq 19 end it 'does not modify output if there is no honeybadger id' do main_app = lambda do |env| [200, {}, ["<!-- HONEYBADGER ERROR -->"]] end informer_app = Honeybadger::UserInformer.new(main_app) ShamRack.mount(informer_app, "example.com") response = Net::HTTP.get_response(URI.parse("http://example.com/")) expect(response.body).to eq '<!-- HONEYBADGER ERROR -->' end end
Version data entries
18 entries across 18 versions & 1 rubygems