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

Changeset 6894

Show
Ignore:
Timestamp:
05/29/07 09:42:13 (2 years ago)
Author:
rick
Message:

fix test cases to match new json output. Closes #8371

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/assertions/selector_assertions.rb

    r6861 r6894  
    587587          unescaped= rjs_string.gsub('\"', '"') 
    588588          unescaped.gsub!('\n', "\n") 
     589          unescaped.gsub!('\076', '>') 
     590          unescaped.gsub!('\074', '<') 
    589591          # RJS encodes non-ascii characters. 
    590592          unescaped.gsub!(RJS_PATTERN_UNICODE_ESCAPED_CHAR) {|u| [$1.hex].pack('U*')} 
  • trunk/actionpack/test/template/javascript_helper_test.rb

    r6057 r6894  
    3737      page.replace_html 'header', "<h1>Greetings</h1>" 
    3838    end 
    39     assert_dom_equal %(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);; return false;">Greet me!</a>), html 
     39    assert_dom_equal %(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);; return false;">Greet me!</a>), html 
    4040  end 
    4141 
     
    4444      page.replace_html 'header', "<h1>Greetings</h1>" 
    4545    end 
    46     assert_dom_equal %(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);; return false;">Greet me!</a>), html 
     46    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 
    4747  end 
    4848 
     
    5656      page.replace_html 'header', "<h1>Greetings</h1>" 
    5757    end 
    58     assert_dom_equal %(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);;" value="Greet me!" />), html 
     58    assert_dom_equal %(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);;" value="Greet me!" />), html 
    5959  end 
    6060 
     
    6363      page.replace_html 'header', "<h1>Greetings</h1>" 
    6464    end 
    65     assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);;" value="Greet me!" />), html 
     65    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 
    6666  end 
    6767end 
  • trunk/actionpack/test/template/prototype_helper_test.rb

    r6775 r6894  
    233233   
    234234  def test_insert_html_with_string 
    235     assert_equal 'new Insertion.Top("element", "<p>This is a test</p>");', 
     235    assert_equal 'new Insertion.Top("element", "\\074p\\076This is a test\\074/p\\076");', 
    236236      @generator.insert_html(:top, 'element', '<p>This is a test</p>') 
    237     assert_equal 'new Insertion.Bottom("element", "<p>This is a test</p>");', 
     237    assert_equal 'new Insertion.Bottom("element", "\\074p\076This is a test\\074/p\076");', 
    238238      @generator.insert_html(:bottom, 'element', '<p>This is a test</p>') 
    239     assert_equal 'new Insertion.Before("element", "<p>This is a test</p>");', 
     239    assert_equal 'new Insertion.Before("element", "\\074p\076This is a test\\074/p\076");', 
    240240      @generator.insert_html(:before, 'element', '<p>This is a test</p>') 
    241     assert_equal 'new Insertion.After("element", "<p>This is a test</p>");', 
     241    assert_equal 'new Insertion.After("element", "\\074p\076This is a test\\074/p\076");', 
    242242      @generator.insert_html(:after, 'element', '<p>This is a test</p>') 
    243243  end 
    244244   
    245245  def test_replace_html_with_string 
    246     assert_equal 'Element.update("element", "<p>This is a test</p>");', 
     246    assert_equal 'Element.update("element", "\\074p\\076This is a test\\074/p\\076");', 
    247247      @generator.replace_html('element', '<p>This is a test</p>') 
    248248  end 
    249249   
    250250  def test_replace_element_with_string 
    251     assert_equal 'Element.replace("element", "<div id=\"element\"><p>This is a test</p></div>");', 
     251    assert_equal 'Element.replace("element", "\\074div id=\"element\"\\076\\074p\\076This is a test\\074/p\\076\\074/div\\076");', 
    252252      @generator.replace('element', '<div id="element"><p>This is a test</p></div>') 
    253253  end 
     
    305305     
    306306    assert_equal <<-EOS.chomp, @generator.to_s 
    307 new Insertion.Top("element", "<p>This is a test</p>"); 
    308 new Insertion.Bottom("element", "<p>This is a test</p>"); 
     307new Insertion.Top("element", "\\074p\\076This is a test\\074/p\\076"); 
     308new Insertion.Bottom("element", "\\074p\\076This is a test\\074/p\\076"); 
    309309["foo", "bar"].each(Element.remove); 
    310 Element.update("baz", "<p>This is a test</p>"); 
     310Element.update("baz", "\\074p\\076This is a test\\074/p\\076"); 
    311311    EOS 
    312312  end