Skip to content

Commit

Permalink
use correct method name
Browse files Browse the repository at this point in the history
Thanks @mxie!
  • Loading branch information
joelhawksley committed May 20, 2020
1 parent a77f280 commit a632d06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/github/rails_view_render_literal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_rails_view_render_literal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ 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
end

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
Expand Down

0 comments on commit a632d06

Please sign in to comment.