Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben VandenBos committed Sep 24, 2008
1 parent c095954 commit ea31323
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/render_partial_comments_test.rb
@@ -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

0 comments on commit ea31323

Please sign in to comment.