Skip to content

Commit

Permalink
Add regression test for capture handling in Rails (#917)
Browse files Browse the repository at this point in the history
* Add regression test for Rails capture handling

* Do not use class_names

---------

Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
  • Loading branch information
timriley and minad authored Apr 17, 2023
1 parent 0c377d6 commit c8332b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/rails/app/views/slim/attributes.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/ Exercises Temple `:capture` handling (used here for preparing HTML attributes) with the
/ Rails-specific Temple generators
.static class="#{['a', 'b'].join('-')}"
5 changes: 5 additions & 0 deletions test/rails/test/test_slim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class TestSlim < ActionDispatch::IntegrationTest
assert_xpath '//input[@id="entry_name" and @name="entry[name]" and @type="text"]'
end

test "attributes" do
get "/slim/attributes"
assert_html "<div class=\"static a-b\"></div>"
end

test "splat" do
get "/slim/splat"
assert_html "<div id=\"splat\"><splat>Hello</splat></div>"
Expand Down

0 comments on commit c8332b3

Please sign in to comment.