Skip to content

Commit 125b364

Browse files
Stub ReactOnRailsPro::Utils.pro_attribution_comment for consistent test behavior
1 parent b9c0c5b commit 125b364

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/dummy/spec/system/integration_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ def finished_all_ajax_requests?
9393
react_on_rails_pro_version: "",
9494
rsc_support_enabled?: false
9595
)
96+
97+
# Stub ReactOnRailsPro::Utils.pro_attribution_comment for all tests
98+
# since react_on_rails_pro? is set to true by default
99+
pro_module = Module.new
100+
utils_module = Module.new do
101+
def self.pro_attribution_comment
102+
"<!-- Powered by React on Rails Pro (c) ShakaCode | Licensed -->"
103+
end
104+
end
105+
stub_const("ReactOnRailsPro", pro_module)
106+
stub_const("ReactOnRailsPro::Utils", utils_module)
96107
end
97108

98109
around do |example|

0 commit comments

Comments
 (0)