Skip to content

Commit

Permalink
add failing test for turbo_frame_tag helper regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Wilson committed Dec 14, 2023
1 parent 4eb4e92 commit d175896
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/frames/frames_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ class Turbo::FramesHelperTest < ActionView::TestCase
assert_dom_equal %(<turbo-frame id="comments_article_1"></turbo-frame>), turbo_frame_tag(record, "comments")
end

test "string frame within a double model frame" do
article = Article.new(id: 1)
comment = Comment.new(id: 1)

assert_dom_equal %(<turbo-frame id="article_1_comment_1"></turbo-frame>), turbo_frame_tag(article, comment)
end

test "string frame with non-record array" do
assert_dom_equal %(<turbo-frame id="foo_1_2"></turbo-frame>), turbo_frame_tag(['foo', 1, 2])
assert_dom_equal %(<turbo-frame id="foo_1_2"></turbo-frame>), turbo_frame_tag(["foo", 1, 2])
end

test "block style" do
Expand Down

0 comments on commit d175896

Please sign in to comment.