Skip to content

Commit 9631355

Browse files
authored
Fix uninitialized constant RSpec::Rails::OpenStruct error
This started to occur on recent test suite runs. It may be related to a json gem update that removed the ostruct dependency as I encountered this with turbo_tests and a fix for that is in serpapi/turbo_tests#49 with more details.
1 parent 967a54d commit 9631355

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/rspec/rails/example/view_example_group_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'ostruct'
12
require 'support/group_failure_formatter'
23

34
module RSpec::Rails
@@ -187,7 +188,7 @@ def _default_file_to_render; end # Stub method
187188
Class.new do
188189
include ViewExampleGroup::ExampleMethods
189190
def controller
190-
@controller ||= OpenStruct.new(params: nil)
191+
@controller ||= ::OpenStruct.new(params: nil)
191192
end
192193
end.new
193194
end

0 commit comments

Comments
 (0)