Changeset 8034
- Timestamp:
- 10/26/07 05:32:30 (1 year ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/assertions/selector_assertions.rb (modified) (1 diff)
- trunk/actionpack/test/template/date_helper_test.rb (modified) (1 diff)
- trunk/actionpack/test/template/javascript_helper_test.rb (modified) (4 diffs)
- trunk/actionpack/test/template/prototype_helper_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8033 r8034 1 1 *SVN* 2 3 * Update tests for ActiveSupport's JSON escaping change. [rick] 2 4 3 5 * FormHelper's auto_index should use #to_param instead of #id_before_type_cast. Closes #9994 [mattly] trunk/actionpack/lib/action_controller/assertions/selector_assertions.rb
r7437 r8034 592 592 # RJS encodes double quotes and line breaks. 593 593 unescaped= rjs_string.gsub('\"', '"') 594 unescaped.gsub!(/\\\//, '/') 594 595 unescaped.gsub!('\n', "\n") 595 596 unescaped.gsub!('\076', '>') trunk/actionpack/test/template/date_helper_test.rb
r7011 r8034 13 13 def id_before_type_cast 14 14 123 15 end 16 def to_param 17 '123' 15 18 end 16 19 end trunk/actionpack/test/template/javascript_helper_test.rb
r7581 r8034 39 39 page.replace_html 'header', "<h1>Greetings</h1>" 40 40 end 41 assert_dom_equal %(<a href="#" onclick="Element.update("header", "\\074h1\\076Greetings\\074 /h1\\076");; return false;">Greet me!</a>), html41 assert_dom_equal %(<a href="#" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");; return false;">Greet me!</a>), html 42 42 end 43 43 … … 46 46 page.replace_html 'header', "<h1>Greetings</h1>" 47 47 end 48 assert_dom_equal %(<a href="#" class="updater" onclick="Element.update("header", "\\074h1\\076Greetings\\074 /h1\\076");; return false;">Greet me!</a>), html48 assert_dom_equal %(<a href="#" class="updater" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");; return false;">Greet me!</a>), html 49 49 end 50 50 … … 68 68 page.replace_html 'header', "<h1>Greetings</h1>" 69 69 end 70 assert_dom_equal %(<input type="button" onclick="Element.update("header", "\\074h1\\076Greetings\\074 /h1\\076");;" value="Greet me!" />), html70 assert_dom_equal %(<input type="button" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");;" value="Greet me!" />), html 71 71 end 72 72 … … 75 75 page.replace_html 'header', "<h1>Greetings</h1>" 76 76 end 77 assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update("header", "\\074h1\\076Greetings\\074 /h1\\076");;" value="Greet me!" />), html77 assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update("header", "\\074h1\\076Greetings\\074\\/h1\\076");;" value="Greet me!" />), html 78 78 end 79 79 trunk/actionpack/test/template/prototype_helper_test.rb
r7668 r8034 304 304 305 305 def test_insert_html_with_string 306 assert_equal 'new Insertion.Top("element", "\\074p\\076This is a test\\074 /p\\076");',306 assert_equal 'new Insertion.Top("element", "\\074p\\076This is a test\\074\\/p\\076");', 307 307 @generator.insert_html(:top, 'element', '<p>This is a test</p>') 308 assert_equal 'new Insertion.Bottom("element", "\\074p\076This is a test\\074 /p\076");',308 assert_equal 'new Insertion.Bottom("element", "\\074p\076This is a test\\074\\/p\076");', 309 309 @generator.insert_html(:bottom, 'element', '<p>This is a test</p>') 310 assert_equal 'new Insertion.Before("element", "\\074p\076This is a test\\074 /p\076");',310 assert_equal 'new Insertion.Before("element", "\\074p\076This is a test\\074\\/p\076");', 311 311 @generator.insert_html(:before, 'element', '<p>This is a test</p>') 312 assert_equal 'new Insertion.After("element", "\\074p\076This is a test\\074 /p\076");',312 assert_equal 'new Insertion.After("element", "\\074p\076This is a test\\074\\/p\076");', 313 313 @generator.insert_html(:after, 'element', '<p>This is a test</p>') 314 314 end 315 315 316 316 def test_replace_html_with_string 317 assert_equal 'Element.update("element", "\\074p\\076This is a test\\074 /p\\076");',317 assert_equal 'Element.update("element", "\\074p\\076This is a test\\074\\/p\\076");', 318 318 @generator.replace_html('element', '<p>This is a test</p>') 319 319 end 320 320 321 321 def test_replace_element_with_string 322 assert_equal 'Element.replace("element", "\\074div id=\"element\"\\076\\074p\\076This is a test\\074 /p\\076\\074/div\\076");',322 assert_equal 'Element.replace("element", "\\074div id=\"element\"\\076\\074p\\076This is a test\\074\\/p\\076\\074\\/div\\076");', 323 323 @generator.replace('element', '<div id="element"><p>This is a test</p></div>') 324 324 end … … 357 357 358 358 def test_redirect_to 359 assert_equal 'window.location.href = "http: //www.example.com/welcome";',359 assert_equal 'window.location.href = "http:\\/\\/www.example.com\\/welcome";', 360 360 @generator.redirect_to(:action => 'welcome') 361 361 end … … 376 376 377 377 assert_equal <<-EOS.chomp, @generator.to_s 378 new Insertion.Top("element", "\\074p\\076This is a test\\074 /p\\076");379 new Insertion.Bottom("element", "\\074p\\076This is a test\\074 /p\\076");378 new Insertion.Top("element", "\\074p\\076This is a test\\074\\/p\\076"); 379 new Insertion.Bottom("element", "\\074p\\076This is a test\\074\\/p\\076"); 380 380 ["foo", "bar"].each(Element.remove); 381 Element.update("baz", "\\074p\\076This is a test\\074 /p\\076");381 Element.update("baz", "\\074p\\076This is a test\\074\\/p\\076"); 382 382 EOS 383 383 end