Skip to content

Commit c83f142

Browse files
authored
Exploratory test cases for rails_view_render_literal
1 parent 29f4a3f commit c83f142

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/test_rails_view_render_literal.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,30 @@ def test_render_component_instance_block_no_offense
7878
assert_equal 0, offenses.count
7979
end
8080

81+
def test_render_component_instance_inline_block_no_offense
82+
offenses = erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb"
83+
<%= render Module::MyClass.new(title: "foo", bar: "baz") { "Content" } %>
84+
ERB
85+
86+
assert_equal 0, offenses.count
87+
end
88+
89+
def test_render_component_instance_data_object_no_offense
90+
offenses = erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb"
91+
<%= render Module::MyClass.new(title: "foo", bar: "baz", data: { foo: "bar" }) %>
92+
ERB
93+
94+
assert_equal 0, offenses.count
95+
end
96+
97+
def test_render_component_instance_data_object_no_offense
98+
offenses = erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb"
99+
<%= render Module::MyClass.new(title: "foo", bar: "baz", data: { foo: "bar" }) %>
100+
ERB
101+
102+
assert_equal 0, offenses.count
103+
end
104+
81105
def test_render_component_collection_no_offense
82106
offenses = erb_investigate cop, <<-ERB, "app/views/foo/index.html.erb"
83107
<%= render MyClass.with_collection(title: "foo", bar: "baz") %>

0 commit comments

Comments
 (0)