diff --git a/spec/lib/airbrake_api/v3/notice_parser_spec.rb b/spec/lib/airbrake_api/v3/notice_parser_spec.rb index 1e59d70..6664720 100644 --- a/spec/lib/airbrake_api/v3/notice_parser_spec.rb +++ b/spec/lib/airbrake_api/v3/notice_parser_spec.rb @@ -91,6 +91,14 @@ describe AirbrakeApi::V3::NoticeParser do expect(parser.attributes[:notifier]).to eq(notifier_params) end + it 'takes the hostname from the context' do + parser = described_class.new( + 'errors' => ['MyError'], + 'context' => { 'hostname' => 'app01.infra.example.com', 'url' => 'http://example.com/some-page' }, + 'environment' => {}) + expect(parser.attributes[:server_environment]['hostname']).to eq('app01.infra.example.com') + end + def build_params_for(fixture, options = {}) json = Rails.root.join('spec', 'fixtures', fixture).read data = JSON.parse(json) -- libgit2 0.21.2