Skip to content

Commit

Permalink
Make trunk tests not break with Rails 2.0.1.
Browse files Browse the repository at this point in the history
git-svn-id: svn://hamptoncatlin.com/haml/trunk@689 7063305b-7217-0410-af8c-cdc13e5119b9
  • Loading branch information
nex3 committed Dec 11, 2007
1 parent ce85654 commit a4c5b79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions test/haml/helper_test.rb
Expand Up @@ -79,6 +79,8 @@ def test_action_view_included
end

def test_form_tag
# This is usually provided by ActionController::Base.
def @base.protect_against_forgery?; false; end
result = render("- form_tag 'foo' do\n %p bar\n %strong baz", :action_view)
should_be = "<form action=\"foo\" method=\"post\">\n <p>bar</p>\n <strong>baz</strong>\n</form>\n"
assert_equal(should_be, result)
Expand Down
8 changes: 5 additions & 3 deletions test/haml/template_test.rb
Expand Up @@ -2,9 +2,7 @@

require 'test/unit'
require 'rubygems'
require 'active_support'
require 'action_controller'
require 'action_view'
require 'action_pack'

require File.dirname(__FILE__) + '/../../lib/haml'
require 'haml/template'
Expand All @@ -30,6 +28,10 @@ def setup
Haml::Template.options = { :filters => { 'test'=>TestFilter } }
@base = ActionView::Base.new(File.dirname(__FILE__) + "/templates/", {'article' => Article.new, 'foo' => 'value one'})
@base.send(:evaluate_assigns)

# This is used by form_for.
# It's usually provided by ActionController::Base.
def @base.protect_against_forgery?; false; end
end

def render(text)
Expand Down

0 comments on commit a4c5b79

Please sign in to comment.