Skip to content

Commit c8965f2

Browse files
committed
Update tests to use ProUtils for immediate_hydration
Changes test setup to stub ReactOnRails::ProUtils.immediate_hydration_config instead of setting config.immediate_hydration on ReactOnRails configuration. This aligns with the new architecture where immediate_hydration is a Pro-only configuration option. Also removes config.immediate_hydration from the dummy app initializer as it is no longer a valid ReactOnRails configuration option.
1 parent 638f0ee commit c8965f2

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

spec/dummy/config/initializers/react_on_rails.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ def self.adjust_props_for_client_side_hydration(component_name, props)
4141
config.rendering_props_extension = RenderingPropsExtension
4242
config.components_subdirectory = "startup"
4343
config.auto_load_bundle = true
44-
config.immediate_hydration = false
4544
config.generated_component_packs_loading_strategy = :defer
4645
end

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,8 @@ def self.pro_attribution_comment
3838
stub_const("ReactOnRailsPro", pro_module)
3939
stub_const("ReactOnRailsPro::Utils", utils_module)
4040

41-
# Configure immediate_hydration to true for tests since they expect that behavior
42-
ReactOnRails.configure do |config|
43-
config.immediate_hydration = true
44-
end
45-
end
46-
47-
after do
48-
# Reset to default - avoid validation issues by setting directly
49-
ReactOnRails.configuration.immediate_hydration = false
41+
# Stub immediate_hydration to true for tests since they expect that behavior
42+
allow(ReactOnRails::ProUtils).to receive(:immediate_hydration_config).and_return(true)
5043
end
5144

5245
let(:hash) do

spec/dummy/spec/system/integration_spec.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,9 @@ def self.pro_attribution_comment
104104
end
105105
stub_const("ReactOnRailsPro", pro_module)
106106
stub_const("ReactOnRailsPro::Utils", utils_module)
107-
end
108107

109-
around do |example|
110-
ReactOnRails.configure { |config| config.immediate_hydration = true }
111-
example.run
112-
ReactOnRails.configure { |config| config.immediate_hydration = false }
108+
# Stub immediate_hydration to true since these tests expect that behavior
109+
allow(ReactOnRails::ProUtils).to receive(:immediate_hydration_config).and_return(true)
113110
end
114111
end
115112

0 commit comments

Comments
 (0)