Skip to content

Commit

Permalink
Update test/sandbox/test/rendering_test.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Cameron Dutro <camertron@gmail.com>
  • Loading branch information
reeganviljoen and camertron authored Nov 19, 2024
1 parent 3e106a9 commit 29aa3ad
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/sandbox/test/rendering_test.rb
Original file line number Diff line number Diff line change
@@ -15,14 +15,12 @@ def test_render_inline_allocations
ViewComponent::CompileCache.cache.delete(MyComponent)
MyComponent.ensure_compiled

if Rails.version.to_f >= 8.0
assert_allocations("3.4.0" => 109, "3.3.6" => 124, "3.3.0" => 127, "3.2.6" => 114, "3.1.6" => 114, "3.0.7" => 123) do
render_inline(MyComponent.new)
end
else
assert_allocations("3.4.0" => 109, "3.3.6" => 115, "3.3.0" => 127, "3.2.6" => 114, "3.1.6" => 114, "3.0.7" => 123) do
render_inline(MyComponent.new)
end
allocations = Rails.version.to_f >= 8.0 ?
{ "3.4.0" => 109, "3.3.6" => 124, "3.3.0" => 127, "3.2.6" => 114, "3.1.6" => 114, "3.0.7" => 123 } :
{ "3.4.0" => 109, "3.3.6" => 115, "3.3.0" => 127, "3.2.6" => 114, "3.1.6" => 114, "3.0.7" => 123 }

assert_allocations(**allocations) do
render_inline(MyComponent.new)
end

assert_selector("div", text: "hello,world!")

0 comments on commit 29aa3ad

Please sign in to comment.