File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,11 +51,6 @@ def test_send_request_delete_with_success_response
5151 assert_nil ( response_body )
5252 end
5353
54- # Regression: a 200 response whose body text contains the substring "error" (e.g.
55- # inside a WhatsApp template body) must not be treated as an error. Previously the
56- # client passed the raw body String to `response_error?`, which delegated to
57- # `String#[]` — a substring scan — and raised HttpResponseError for any body
58- # containing the word "error".
5954 def test_send_request_does_not_raise_when_body_text_contains_error_substring
6055 payload = {
6156 'data' => [ {
Original file line number Diff line number Diff line change @@ -19,10 +19,6 @@ def test_response_error_returns_nil_for_hash_without_error_key
1919 assert_nil ( GenericErrorResponse . response_error? ( response : response ) )
2020 end
2121
22- # Regression guard: a raw JSON string that happens to contain the substring "error"
23- # (e.g. inside a template body) must NOT trigger an error. Previously String#[] was
24- # used as a substring scan, causing false positives for any 200 response body
25- # mentioning the word "error".
2622 def test_response_error_returns_false_for_string_input
2723 body = '{"data":[{"text":"si tu cupón te da algún error, avísanos"}]}'
2824 assert_equal ( false , GenericErrorResponse . response_error? ( response : body ) )
You can’t perform that action at this time.
0 commit comments