Skip to content

Commit 5a459ce

Browse files
committed
Fix support for namespaced fixtures with Rails 7.1
1 parent b109337 commit 5a459ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/rspec/rails/fixture_support.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ module Fixtures
4343
if ::Rails.version.to_f >= 7.1
4444
def fixtures(*args)
4545
super.tap do
46-
fixture_sets.each_key do |fixture_name|
47-
proxy_method_warning_if_called_in_before_context_scope(fixture_name)
46+
fixture_sets.each_pair do |method_name, fixture_name|
47+
proxy_method_warning_if_called_in_before_context_scope(method_name, fixture_name)
4848
end
4949
end
5050
end
5151

52-
def proxy_method_warning_if_called_in_before_context_scope(fixture_name)
53-
define_method(fixture_name) do |*args, **kwargs, &blk|
52+
def proxy_method_warning_if_called_in_before_context_scope(method_name, fixture_name)
53+
define_method(method_name) do |*args, **kwargs, &blk|
5454
if RSpec.current_scope == :before_context_hook
5555
RSpec.warn_with("Calling fixture method in before :context ")
5656
else

0 commit comments

Comments
 (0)