mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add tests for render template/partial with variants option.
This commit is contained in:
parent
a84cfe9340
commit
8feb7c934f
3 changed files with 10 additions and 0 deletions
1
actionview/test/fixtures/comments/empty.html+grid.erb
vendored
Normal file
1
actionview/test/fixtures/comments/empty.html+grid.erb
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>No Comment</h1>
|
1
actionview/test/fixtures/test/_partial_with_variants.html+grid.erb
vendored
Normal file
1
actionview/test/fixtures/test/_partial_with_variants.html+grid.erb
vendored
Normal file
|
@ -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 a new issue