Skip to content

Commit 8d3cf79

Browse files
justin808claude
andcommitted
Reset connection_without_retries in streaming tests
The mock_request_and_response method was only resetting @connection but not @connection_without_retries. This caused tests to use a cached connection instead of the mocked one, leading to actual component rendering instead of using the mocked streaming response. This fix ensures both connection instance variables are reset to nil before each test, allowing the mock to work correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent b495c31 commit 8d3cf79

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

react_on_rails_pro/spec/dummy/spec/helpers/react_on_rails_pro_helper_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ def response; end
330330
def mock_request_and_response(mock_chunks = chunks, count: 1)
331331
# Reset connection instance variables to ensure clean state for tests
332332
ReactOnRailsPro::Request.instance_variable_set(:@connection, nil)
333+
ReactOnRailsPro::Request.instance_variable_set(:@connection_without_retries, nil)
333334
original_httpx_plugin = HTTPX.method(:plugin)
334335
allow(HTTPX).to receive(:plugin) do |*args|
335336
original_httpx_plugin.call(:mock_stream).plugin(*args)

0 commit comments

Comments
 (0)