This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ben VandenBos
committed
Sep 24, 2008
1 parent
c095954
commit ea31323
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,41 @@ | |||
require 'test/unit' | |||
|
|||
# first defined some stubs... | |||
module ActionView; end; | |||
|
|||
class ActionView::Base | |||
|
|||
def render_partial_wrapper(partial_path) | |||
render_partial(partial_path) | |||
end | |||
|
|||
private | |||
|
|||
def render_partial(partial_path, object_assigns = nil, local_assigns = {}) | |||
"<b>Some junk html</b>" | |||
end | |||
|
|||
end | |||
|
|||
|
|||
require File.join(File.dirname(__FILE__), '../lib', 'render_partial_comments') | |||
|
|||
class RenderPartialCommentsTest < Test::Unit::TestCase | |||
|
|||
def test_disabled | |||
a = ActionView::Base.new | |||
$render_partial_comments = false | |||
|
|||
r = a.render_partial_wrapper('user/view') | |||
assert_equal("<b>Some junk html</b>", r) | |||
end | |||
|
|||
def test_enabled | |||
a = ActionView::Base.new | |||
$render_partial_comments = true | |||
|
|||
r = a.render_partial_wrapper('user/view') | |||
assert_equal("<!-- render_begin 'user/view' --><b>Some junk html</b><!-- render_end 'user/view' -->", r) | |||
end | |||
|
|||
end |