Skip to content

Commit cf5a797

Browse files
justin808claude
andcommitted
Add response stub to mock request object
The HTTPX::ErrorResponse constructor calls request.response during initialization. Add this method stub to the instance_double to prevent the test from failing with: received unexpected message :response with (no args) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 537816a commit cf5a797

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

react_on_rails_pro/spec/react_on_rails_pro/request_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
yielder.call("#{original_chunks[0]}\n")
248248
# Simulate connection error mid-stream by creating a mock error response
249249
# Create a minimal mock request object that satisfies the ErrorResponse constructor
250-
mock_request = instance_double(HTTPX::Request, uri: URI(render_full_url))
250+
mock_request = instance_double(HTTPX::Request, uri: URI(render_full_url), response: nil)
251251
error_response = HTTPX::ErrorResponse.new(
252252
mock_request,
253253
StandardError.new("Connection closed")

0 commit comments

Comments
 (0)