diff --git a/lib/rubocop/cop/github/rails_view_render_literal.rb b/lib/rubocop/cop/github/rails_view_render_literal.rb index 2443c0b..0fe972e 100644 --- a/lib/rubocop/cop/github/rails_view_render_literal.rb +++ b/lib/rubocop/cop/github/rails_view_render_literal.rb @@ -25,7 +25,7 @@ class RailsViewRenderLiteral < Cop PATTERN def_node_matcher :render_collection?, <<-PATTERN - (send nil? :render (send _ :collection ...) ...) + (send nil? :render (send _ :with_collection ...) ...) PATTERN def_node_matcher :render_with_options?, <<-PATTERN diff --git a/test/test_rails_view_render_literal.rb b/test/test_rails_view_render_literal.rb index acaec77..649725b 100644 --- a/test/test_rails_view_render_literal.rb +++ b/test/test_rails_view_render_literal.rb @@ -72,7 +72,7 @@ def test_render_component_instance_block_no_offense def test_render_component_collection_no_offense erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb" - <%= render MyClass.collection(title: "foo", bar: "baz") %> + <%= render MyClass.with_collection(title: "foo", bar: "baz") %> ERB assert_equal 0, cop.offenses.count @@ -80,7 +80,7 @@ def test_render_component_collection_no_offense def test_render_component_module_collection_no_offense erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb" - <%= render Foo::MyClass.collection(title: "foo", bar: "baz") %> + <%= render Foo::MyClass.with_collection(title: "foo", bar: "baz") %> ERB assert_equal 0, cop.offenses.count