Upgrade to Rails 2.2.0

As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
This commit is contained in:
Jacques Distler 2008-10-27 01:47:01 -05:00
parent 39348c65c2
commit 7600aef48b
827 changed files with 123652 additions and 11027 deletions

View file

@ -3,15 +3,10 @@ require 'abstract_unit'
class JavaScriptHelperTest < ActionView::TestCase
tests ActionView::Helpers::JavaScriptHelper
def test_define_javascript_functions
assert_deprecated(/javascript_include_tag/) do
# check if prototype.js is included first
src = define_javascript_functions
assert_not_nil src.split("\n")[1].match(/Prototype JavaScript framework/)
attr_accessor :template_format, :output_buffer
# check that scriptaculous.js is not in here, only needed if loaded remotely
assert_nil src.split("\n")[1].match(/var Scriptaculous = \{/)
end
def setup
@template = self
end
def test_escape_javascript
@ -51,7 +46,7 @@ class JavaScriptHelperTest < ActionView::TestCase
end
def test_link_to_function_with_href
assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>),
assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>),
link_to_function("Greeting", "alert('Hello world!')", :href => 'http://example.com/')
end
@ -85,8 +80,12 @@ class JavaScriptHelperTest < ActionView::TestCase
end
def test_javascript_tag
self.output_buffer = 'foo'
assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>",
javascript_tag("alert('hello')")
assert_equal 'foo', output_buffer, 'javascript_tag without a block should not concat to output_buffer'
end
def test_javascript_tag_with_options
@ -94,16 +93,16 @@ class JavaScriptHelperTest < ActionView::TestCase
javascript_tag("alert('hello')", :id => "the_js_tag")
end
def test_javascript_tag_with_block
_erbout = ''
javascript_tag { _erbout.concat "alert('hello')" }
assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", _erbout
def test_javascript_tag_with_block_in_erb
__in_erb_template = ''
javascript_tag { concat "alert('hello')" }
assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", output_buffer
end
def test_javascript_tag_with_block_and_options
_erbout = ''
javascript_tag(:id => "the_js_tag") { _erbout.concat "alert('hello')" }
assert_dom_equal "<script id=\"the_js_tag\" type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", _erbout
def test_javascript_tag_with_block_and_options_in_erb
__in_erb_template = ''
javascript_tag(:id => "the_js_tag") { concat "alert('hello')" }
assert_dom_equal "<script id=\"the_js_tag\" type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", output_buffer
end
def test_javascript_cdata_section