diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-29 08:09:00 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-29 08:09:00 +0000 |
commit | 2d8679993c3e7ec2920fd818dacc7cb2000b9f89 (patch) | |
tree | c50a31fb94c83be612ee314e5a056e0360658068 /actionpack/test/template | |
parent | 0ffcceffac52cc4ed373eb9db27d6c776b5d96b7 (diff) | |
download | rails-2d8679993c3e7ec2920fd818dacc7cb2000b9f89.tar.gz rails-2d8679993c3e7ec2920fd818dacc7cb2000b9f89.tar.bz2 rails-2d8679993c3e7ec2920fd818dacc7cb2000b9f89.zip |
Fix JavaScriptHelper capitalization and make it compatible with Prototype #1545 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1561 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/javascript_helper.rb | 6 | ||||
-rw-r--r-- | actionpack/test/template/upload_progress_helper_test.rb | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/template/javascript_helper.rb b/actionpack/test/template/javascript_helper.rb index f70703c819..65864fc596 100644 --- a/actionpack/test/template/javascript_helper.rb +++ b/actionpack/test/template/javascript_helper.rb @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../abstract_unit' -class JavascriptHelperTest < Test::Unit::TestCase - include ActionView::Helpers::JavascriptHelper +class JavaScriptHelperTest < Test::Unit::TestCase + include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper @@ -19,7 +19,7 @@ class JavascriptHelperTest < Test::Unit::TestCase def test_define_javascript_functions # check if prototype.js is included first - assert_not_nil define_javascript_functions.split("\n")[1].match(/Prototype: an object-oriented Javascript library/) + assert_not_nil define_javascript_functions.split("\n")[1].match(/Prototype JavaScript framework/) end def test_escape_javascript diff --git a/actionpack/test/template/upload_progress_helper_test.rb b/actionpack/test/template/upload_progress_helper_test.rb index 361aa4bb08..287516b765 100644 --- a/actionpack/test/template/upload_progress_helper_test.rb +++ b/actionpack/test/template/upload_progress_helper_test.rb @@ -39,7 +39,7 @@ class UploadProgressHelperTest < Test::Unit::TestCase include ActionView::Helpers::FormTagHelper include ActionView::Helpers::TagHelper include ActionView::Helpers::UrlHelper - include ActionView::Helpers::JavascriptHelper + include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::UploadProgressHelper def next_upload_id; @upload_id = last_upload_id.succ; end @@ -175,7 +175,7 @@ class UploadProgressHelperTest < Test::Unit::TestCase include ActionView::Helpers::FormTagHelper include ActionView::Helpers::TagHelper include ActionView::Helpers::UrlHelper - include ActionView::Helpers::JavascriptHelper + include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::UploadProgressHelper def next_upload_id; @upload_id = last_upload_id.succ; end @@ -258,14 +258,14 @@ class UploadProgressHelperTest < Test::Unit::TestCase def test_form_tag_with_upload_progress assert_equal( - "<form action=\"http://www.example.com\" enctype=\"multipart/form-data\" method=\"post\" onsubmit=\"if (this.action.indexOf('upload_id') < 0){ this.action += '?upload_id=1'; }this.target = 'UploadTarget1';$('UploadStatus1').innerHTML='Upload starting...'; $('UploadProgressBar1').firstChild.firstChild.style.width='0%'; if (document.uploadStatus1) { document.uploadStatus1.stop(); }document.uploadStatus1 = new Ajax.PeriodicalUpdater('UploadStatus1','http://www.example.com', {script:true, onComplete:function(request){$('UploadStatus1').innerHTML='A message';$('UploadProgressBar1').firstChild.firstChild.style.width='100%';document.uploadStatus1 = null}, asynchronous:true}.extend({decay:1.8,freqency:2.0})); return true\"><iframe id=\"UploadTarget1\" name=\"UploadTarget1\" src=\"\" style=\"width:0px;height:0px;border:0\"></iframe>", + "<form action=\"http://www.example.com\" enctype=\"multipart/form-data\" method=\"post\" onsubmit=\"if (this.action.indexOf('upload_id') < 0){ this.action += '?upload_id=1'; }this.target = 'UploadTarget1';$('UploadStatus1').innerHTML='Upload starting...'; $('UploadProgressBar1').firstChild.firstChild.style.width='0%'; if (document.uploadStatus1) { document.uploadStatus1.stop(); }document.uploadStatus1 = new Ajax.PeriodicalUpdater('UploadStatus1','http://www.example.com', {onComplete:function(request){$('UploadStatus1').innerHTML='A message';$('UploadProgressBar1').firstChild.firstChild.style.width='100%';document.uploadStatus1 = null}, evalScripts:true, asynchronous:true}.extend({decay:1.8,freqency:2.0})); return true\"><iframe id=\"UploadTarget1\" name=\"UploadTarget1\" src=\"\" style=\"width:0px;height:0px;border:0\"></iframe>", form_tag_with_upload_progress ) end def test_form_tag_with_upload_progress_custom assert_equal( - "<form action=\"http://www.example.com\" enctype=\"multipart/form-data\" method=\"post\" onsubmit=\"if (this.action.indexOf('upload_id') < 0){ this.action += '?upload_id=5'; }this.target = 'awindow';$('UploadStatus0').innerHTML='Upload starting...'; $('UploadProgressBar0').firstChild.firstChild.style.width='0%'; alert('foo'); if (document.uploadStatus0) { document.uploadStatus0.stop(); }document.uploadStatus0 = new Ajax.PeriodicalUpdater('UploadStatus0','http://www.example.com', {script:true, onComplete:function(request){$('UploadStatus0').innerHTML='A message';$('UploadProgressBar0').firstChild.firstChild.style.width='100%';document.uploadStatus0 = null; alert('bar')}, asynchronous:true}.extend({decay:7,freqency:6})); return true\" target=\"awindow\">", + "<form action=\"http://www.example.com\" enctype=\"multipart/form-data\" method=\"post\" onsubmit=\"if (this.action.indexOf('upload_id') < 0){ this.action += '?upload_id=5'; }this.target = 'awindow';$('UploadStatus0').innerHTML='Upload starting...'; $('UploadProgressBar0').firstChild.firstChild.style.width='0%'; alert('foo'); if (document.uploadStatus0) { document.uploadStatus0.stop(); }document.uploadStatus0 = new Ajax.PeriodicalUpdater('UploadStatus0','http://www.example.com', {onComplete:function(request){$('UploadStatus0').innerHTML='A message';$('UploadProgressBar0').firstChild.firstChild.style.width='100%';document.uploadStatus0 = null; alert('bar')}, evalScripts:true, asynchronous:true}.extend({decay:7,freqency:6})); return true\" target=\"awindow\">", form_tag_with_upload_progress({:upload_id => 5}, {:begin => "alert('foo')", :finish => "alert('bar')", :frequency => 6, :decay => 7, :target => 'awindow'}) ) end |