Skip to content

Commit fa1b1a3

Browse files
Fix ReactOnRailsPro stub in helper specs
Fixed stub to properly mock ReactOnRailsPro.configuration method instead of using receive_message_chain which requires the module to already implement the configuration method. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 3173ace commit fa1b1a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class PlainReactOnRailsHelper
2727
)
2828

2929
# Mock Pro gem configuration and helper for immediate_hydration
30-
allow(ReactOnRailsPro).to receive_message_chain(:configuration, :immediate_hydration).and_return(true)
30+
pro_config = Struct.new(:immediate_hydration).new(true)
31+
allow(ReactOnRailsPro).to receive(:configuration).and_return(pro_config)
3132
allow(ReactOnRailsPro::Helper).to receive(:enhance_component_script_data) do |args|
3233
if args[:render_options].immediate_hydration
3334
dom_id = args[:render_options].dom_id

0 commit comments

Comments
 (0)