mirror of https://github.com/rails/rails
Add tests for render template/partial with variants option.
This commit is contained in:
parent
a84cfe9340
commit
8feb7c934f
|
@ -0,0 +1 @@
|
|||
<h1>No Comment</h1>
|
|
@ -0,0 +1 @@
|
|||
<h1>Partial with variants</h1>
|
|
@ -83,6 +83,10 @@ module RenderTestCases
|
|||
assert_equal "<h1>Kein Kommentar</h1>", @view.render(template: "comments/empty", locale: [:de])
|
||||
end
|
||||
|
||||
def test_render_template_with_variants
|
||||
assert_equal "<h1>No Comment</h1>\n", @view.render(template: "comments/empty", variants: :grid)
|
||||
end
|
||||
|
||||
def test_render_file_with_handlers
|
||||
assert_equal "<h1>No Comment</h1>\n", @view.render(file: "comments/empty", handlers: [:builder])
|
||||
assert_equal "<h1>No Comment</h1>\n", @view.render(file: "comments/empty", handlers: :builder)
|
||||
|
@ -170,6 +174,10 @@ module RenderTestCases
|
|||
assert_equal "partial html", @view.render(partial: "test/partial")
|
||||
end
|
||||
|
||||
def test_render_partial_with_variants
|
||||
assert_equal "<h1>Partial with variants</h1>\n", @view.render(partial: "test/partial_with_variants", variants: :grid)
|
||||
end
|
||||
|
||||
def test_render_partial_with_selected_format
|
||||
assert_equal "partial html", @view.render(partial: "test/partial", formats: :html)
|
||||
assert_equal "partial js", @view.render(partial: "test/partial", formats: [:js])
|
||||
|
|
Loading…
Reference in New Issue