Skip to content

Commit 797200d

Browse files
committed
Adding test for RailsViewRenderLiteral check on components using with_content
1 parent 527a7e0 commit 797200d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/test_rails_view_render_literal.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ def test_render_component_instance_no_offense
6262
assert_equal 0, cop.offenses.count
6363
end
6464

65+
def test_render_component_instance_with_content_no_offense
66+
erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb"
67+
<%= render MyClass.new(title: "foo", bar: "baz").with_content("foo") %>
68+
ERB
69+
70+
assert_equal 0, cop.offenses.count
71+
end
72+
6573
def test_render_component_instance_block_no_offense
6674
erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb"
6775
<%= render Module::MyClass.new(title: "foo", bar: "baz") do %>Content<% end %>

0 commit comments

Comments
 (0)