aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/javascript_helper_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-08 20:05:39 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-08 20:05:39 -0700
commitff5f155f8dc1d2ba363718c3e17f99719399eab5 (patch)
tree6d6e353284cc9c630697ae92f710df499d2f8197 /actionpack/test/template/javascript_helper_test.rb
parentd9fb021845c0481c5119eebdc534aec427072f7d (diff)
downloadrails-ff5f155f8dc1d2ba363718c3e17f99719399eab5.tar.gz
rails-ff5f155f8dc1d2ba363718c3e17f99719399eab5.tar.bz2
rails-ff5f155f8dc1d2ba363718c3e17f99719399eab5.zip
Use output_buffer reader and writer methods exclusively instead of hitting the instance variable so others can override the methods.
Diffstat (limited to 'actionpack/test/template/javascript_helper_test.rb')
-rw-r--r--actionpack/test/template/javascript_helper_test.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index 4924074c3e..8c649ea544 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -82,12 +82,12 @@ class JavaScriptHelperTest < ActionView::TestCase
end
def test_javascript_tag
- @output_buffer = 'foo'
+ 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'
+ assert_equal 'foo', output_buffer, 'javascript_tag without a block should not concat to output_buffer'
end
def test_javascript_tag_with_options
@@ -96,15 +96,13 @@ class JavaScriptHelperTest < ActionView::TestCase
end
def test_javascript_tag_with_block
- @output_buffer = ''
- javascript_tag { @output_buffer.concat "alert('hello')" }
- assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", @output_buffer
+ 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
- @output_buffer = ''
- javascript_tag(:id => "the_js_tag") { @output_buffer.concat "alert('hello')" }
- assert_dom_equal "<script id=\"the_js_tag\" type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", @output_buffer
+ 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