test/multiverse/suites/grape/grape_test.rb in newrelic_rpm-3.13.2.302 vs test/multiverse/suites/grape/grape_test.rb in newrelic_rpm-3.14.0.305

- old
+ new

@@ -173,11 +173,12 @@ assert_equal expected, last_transaction_trace_request_params end end def test_params_are_captured_on_transaction_events - with_config(:'attributes.include' => 'request.parameters.*') do + with_config(:'attributes.include' => 'request.parameters.*', + :'attributes.exclude' => ['request.*', 'response.*']) do json = { :foo => "bar", :bar => "baz" }.to_json @@ -186,9 +187,23 @@ expected = {"request.parameters.foo" => "bar", "request.parameters.bar" => "baz"} actual = agent_attributes_for_single_event_posted_without_ignored_attributes assert_equal(expected, actual) end + end + + def test_request_and_response_attributes_recorded_as_agent_attributes + post '/grape_ape' + + expected = { + "response.headers.contentType" => last_response.content_type, + "request.headers.contentLength" => last_request.content_length.to_i, + "request.headers.host" => last_request.host, + "request.method" => last_request.request_method + } + actual = agent_attributes_for_single_event_posted_without_ignored_attributes + + assert_equal(expected, actual) end def assert_grape_metrics(expected_txn_name) expected_node_name = 'Middleware/Grape/GrapeTestApi/call' assert_metrics_recorded([