Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8034

Show
Ignore:
Timestamp:
10/26/07 05:32:30 (1 year ago)
Author:
rick
Message:

Update tests for ActiveSupport's JSON escaping change. [rick]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r8033 r8034  
    11*SVN* 
     2 
     3* Update tests for ActiveSupport's JSON escaping change.  [rick] 
    24 
    35* 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  
    592592          # RJS encodes double quotes and line breaks. 
    593593          unescaped= rjs_string.gsub('\"', '"') 
     594          unescaped.gsub!(/\\\//, '/') 
    594595          unescaped.gsub!('\n', "\n") 
    595596          unescaped.gsub!('\076', '>') 
  • trunk/actionpack/test/template/date_helper_test.rb

    r7011 r8034  
    1313      def id_before_type_cast 
    1414        123 
     15      end 
     16      def to_param 
     17        '123' 
    1518      end 
    1619    end 
  • trunk/actionpack/test/template/javascript_helper_test.rb

    r7581 r8034  
    3939      page.replace_html 'header', "<h1>Greetings</h1>" 
    4040    end 
    41     assert_dom_equal %(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);; return false;">Greet me!</a>), html 
     41    assert_dom_equal %(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074\\/h1\\076&quot;);; return false;">Greet me!</a>), html 
    4242  end 
    4343 
     
    4646      page.replace_html 'header', "<h1>Greetings</h1>" 
    4747    end 
    48     assert_dom_equal %(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);; return false;">Greet me!</a>), html 
     48    assert_dom_equal %(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074\\/h1\\076&quot;);; return false;">Greet me!</a>), html 
    4949  end 
    5050 
     
    6868      page.replace_html 'header', "<h1>Greetings</h1>" 
    6969    end 
    70     assert_dom_equal %(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);;" value="Greet me!" />), html 
     70    assert_dom_equal %(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074\\/h1\\076&quot;);;" value="Greet me!" />), html 
    7171  end 
    7272 
     
    7575      page.replace_html 'header', "<h1>Greetings</h1>" 
    7676    end 
    77     assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);;" value="Greet me!" />), html 
     77    assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074\\/h1\\076&quot;);;" value="Greet me!" />), html 
    7878  end 
    7979 
  • trunk/actionpack/test/template/prototype_helper_test.rb

    r7668 r8034  
    304304   
    305305  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");', 
    307307      @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");', 
    309309      @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");', 
    311311      @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");', 
    313313      @generator.insert_html(:after, 'element', '<p>This is a test</p>') 
    314314  end 
    315315   
    316316  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");', 
    318318      @generator.replace_html('element', '<p>This is a test</p>') 
    319319  end 
    320320   
    321321  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");', 
    323323      @generator.replace('element', '<div id="element"><p>This is a test</p></div>') 
    324324  end 
     
    357357   
    358358  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";', 
    360360      @generator.redirect_to(:action => 'welcome') 
    361361  end 
     
    376376     
    377377    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"); 
     378new Insertion.Top("element", "\\074p\\076This is a test\\074\\/p\\076"); 
     379new Insertion.Bottom("element", "\\074p\\076This is a test\\074\\/p\\076"); 
    380380["foo", "bar"].each(Element.remove); 
    381 Element.update("baz", "\\074p\\076This is a test\\074/p\\076"); 
     381Element.update("baz", "\\074p\\076This is a test\\074\\/p\\076"); 
    382382    EOS 
    383383  end