diff --git a/test/haml/helper_test.rb b/test/haml/helper_test.rb index 0918d59f73..f80271015e 100755 --- a/test/haml/helper_test.rb +++ b/test/haml/helper_test.rb @@ -118,7 +118,7 @@ def test_form_tag # This is usually provided by ActionController::Base. def @base.protect_against_forgery?; false; end assert_equal(< +
#{rails_form_opener}

bar

baz
@@ -167,7 +167,7 @@ def test_content_tag_error_wrapping def @base.protect_against_forgery?; false; end error_class = Haml::Util.ap_geq_3? ? "field_with_errors" : "fieldWithErrors" assert_equal(< +
#{rails_form_opener}
HTML diff --git a/test/haml/template_test.rb b/test/haml/template_test.rb index 9786443101..55b0ee517f 100755 --- a/test/haml/template_test.rb +++ b/test/haml/template_test.rb @@ -280,7 +280,7 @@ def test_exceptions_should_work_correctly def test_av_block_deprecation_warning assert_warning(/^DEPRECATION WARNING: - style block helpers are deprecated\. Please use =\./) do assert_equal < +
#{rails_form_opener} Title: Body: @@ -379,7 +379,7 @@ def test_xss_protection_with_nested_haml_tag def test_xss_protection_with_form_for assert_equal(< +#{rails_form_opener} Title: Body: diff --git a/test/test_helper.rb b/test/test_helper.rb index f5f6e2c919..859e116cc7 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -68,4 +68,14 @@ def form_for_calling_convention(name) return "@#{name}, :as => :#{name}, :html => {:class => nil, :id => nil}" if Haml::Util.ap_geq_3? return ":#{name}, @#{name}" end + + def rails_form_attr + return 'accept-charset="UTF-8" ' if Haml::Util.ap_geq?("3.0.0.rc") + return '' + end + + def rails_form_opener + return '' unless Haml::Util.ap_geq?("3.0.0.rc") + return '
' + end end