diff --git a/lib/rubocop/cop/rspec/factory_bot/create_list.rb b/lib/rubocop/cop/rspec/factory_bot/create_list.rb index 964eb37bb..2f580e44b 100644 --- a/lib/rubocop/cop/rspec/factory_bot/create_list.rb +++ b/lib/rubocop/cop/rspec/factory_bot/create_list.rb @@ -161,7 +161,7 @@ def call(corrector) def call_with_block_replacement(node) block = node.body arguments = build_arguments(block, node.receiver.source) - replacement = format_receiver(block.send_node.receiver) + replacement = format_receiver(block.receiver) replacement += format_method_call(block, 'create_list', arguments) replacement += format_block(block) replacement