4646      end 
4747    end 
4848
49-     context  "with config.send_default_pii = true"  do 
50-       before  do 
51-         Sentry . configuration . send_default_pii  =  true 
52-       end 
53- 
54-       it  "records the request's span with query string in data"  do 
55-         stub_normal_response 
56- 
57-         transaction  =  Sentry . start_transaction 
58-         Sentry . get_current_scope . set_span ( transaction ) 
59- 
60-         response  =  Net ::HTTP . get_response ( URI ( "http://example.com/path?foo=bar" ) ) 
61- 
62-         expect ( response . code ) . to  eq ( "200" ) 
63-         expect ( transaction . span_recorder . spans . count ) . to  eq ( 2 ) 
64- 
65-         request_span  =  transaction . span_recorder . spans . last 
66-         expect ( request_span . op ) . to  eq ( "http.client" ) 
67-         expect ( request_span . origin ) . to  eq ( "auto.http.net_http" ) 
68-         expect ( request_span . start_timestamp ) . not_to  be_nil 
69-         expect ( request_span . timestamp ) . not_to  be_nil 
70-         expect ( request_span . start_timestamp ) . not_to  eq ( request_span . timestamp ) 
71-         expect ( request_span . description ) . to  eq ( "GET http://example.com/path" ) 
72-         expect ( request_span . data ) . to  eq ( { 
73-           "http.response.status_code"  =>  200 , 
74-           "url"  =>  "http://example.com/path" , 
75-           "http.request.method"  =>  "GET" , 
76-           "http.query"  =>  "foo=bar" 
77-         } ) 
78-       end 
79-     end 
80- 
81-     context  "with config.send_default_pii = false"  do 
82-       before  do 
83-         Sentry . configuration . send_default_pii  =  false 
84-       end 
49+     it  "records the request's span with query string in data"  do 
50+       stub_normal_response 
8551
86-       it   "records the request's span without query string"   do 
87-          stub_normal_response 
52+       transaction   =   Sentry . start_transaction 
53+       Sentry . get_current_scope . set_span ( transaction ) 
8854
89-         transaction  =  Sentry . start_transaction 
90-         Sentry . get_current_scope . set_span ( transaction ) 
55+       response  =  Net ::HTTP . get_response ( URI ( "http://example.com/path?foo=bar" ) ) 
9156
92-         response  =  Net ::HTTP . get_response ( URI ( "http://example.com/path?foo=bar" ) ) 
93- 
94-         expect ( response . code ) . to  eq ( "200" ) 
95-         expect ( transaction . span_recorder . spans . count ) . to  eq ( 2 ) 
57+       expect ( response . code ) . to  eq ( "200" ) 
58+       expect ( transaction . span_recorder . spans . count ) . to  eq ( 2 ) 
9659
97-          request_span  =  transaction . span_recorder . spans . last 
98-          expect ( request_span . op ) . to  eq ( "http.client" ) 
99-          expect ( request_span . origin ) . to  eq ( "auto.http.net_http" ) 
100-          expect ( request_span . start_timestamp ) . not_to  be_nil 
101-          expect ( request_span . timestamp ) . not_to  be_nil 
102-          expect ( request_span . start_timestamp ) . not_to  eq ( request_span . timestamp ) 
103-          expect ( request_span . description ) . to  eq ( "GET http://example.com/path" ) 
104-          expect ( request_span . data ) . to  eq ( { 
105-            "http.response.status_code"  =>  200 , 
106-            "url"  =>  "http://example.com/path" , 
107-            "http.request.method"  =>  "GET" 
108-         } ) 
109-       end 
60+       request_span  =  transaction . span_recorder . spans . last 
61+       expect ( request_span . op ) . to  eq ( "http.client" ) 
62+       expect ( request_span . origin ) . to  eq ( "auto.http.net_http" ) 
63+       expect ( request_span . start_timestamp ) . not_to  be_nil 
64+       expect ( request_span . timestamp ) . not_to  be_nil 
65+       expect ( request_span . start_timestamp ) . not_to  eq ( request_span . timestamp ) 
66+       expect ( request_span . description ) . to  eq ( "GET http://example.com/path" ) 
67+       expect ( request_span . data ) . to  eq ( { 
68+         "http.response.status_code"  =>  200 , 
69+         "url"  =>  "http://example.com/path" , 
70+         "http.request.method"  =>  "GET" , 
71+         "http.query"   =>   "foo=bar" 
72+       } ) 
11073    end 
11174
11275    it  "supports non-ascii characters in the path"  do 
@@ -348,7 +311,8 @@ def verify_spans(transaction)
348311        expect ( request_span . data ) . to  eq ( { 
349312          "http.response.status_code"  =>  200 , 
350313          "url"  =>  "http://example.com/path" , 
351-           "http.request.method"  =>  "GET" 
314+           "http.request.method"  =>  "GET" , 
315+           "http.query"  =>  "foo=bar" 
352316        } ) 
353317
354318        request_span  =  transaction . span_recorder . spans [ 2 ] 
@@ -361,7 +325,8 @@ def verify_spans(transaction)
361325        expect ( request_span . data ) . to  eq ( { 
362326          "http.response.status_code"  =>  404 , 
363327          "url"  =>  "http://example.com/path" , 
364-           "http.request.method"  =>  "GET" 
328+           "http.request.method"  =>  "GET" , 
329+           "http.query"  =>  "foo=bar" 
365330        } ) 
366331      end 
367332
0 commit comments