Skip to content

Commit a43a8fd

Browse files
committed
Fix controller spec on Rails 6.1
The #config option is removed from activerecord/lib/active_record/test_fixtures.rb
1 parent 20a7647 commit a43a8fd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spec/rspec/rails/example/controller_example_group_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ def my_helper
3636
"other_value"
3737
end
3838
end
39-
config.include mod
39+
40+
# Rails 6.1 removes config from ./activerecord/lib/active_record/test_fixtures.rb
41+
if respond_to?(:config)
42+
config.include mod
43+
else
44+
ActiveRecord::Base.include mod
45+
end
46+
4047
group.class_exec do
4148
let(:my_helper) { "my_value" }
4249
end

0 commit comments

Comments
 (0)