You are here: Home > Latest news from Darcs > Escape quotes in test for compatibility with new Mediacloth

Revision 20080923213700-9043f-d2a3c2...

Escape quotes in test for compatibility with new Mediacloth

test/functional/report_features_test.rb
test/functional/wiki_controller_test.rb

Changes to report_features_test.rb

39
    get :list, :reporter => 'features', :locale => 'en', :format => 'xml'
    get :list, :reporter => 'features', :locale => 'en', :format => 'xml'
39
40
    assert_xml_element '//description['+
    assert_xml_element '//description['+
40
41
                         'contains(text(),' + 
                         'contains(text(),' + 
41
42
                           "'<a href=\"http://test.host/wiki/show/ListLastModifiedFeatures\">ListLastModifiedFeatures</a>')]"
                           "'<a href="http://test.host/wiki/show/ListLastModifiedFeatures">ListLastModifiedFeatures</a>')]"
42
43
  end
  end
43
44
  
  
44
45
  def test_shows_title_for_second_language
  def test_shows_title_for_second_language
45

Changes to wiki_controller_test.rb

347
347
348
    assert_xml_element "//item/description[contains(text(), 'This is the first English version')]"
    assert_xml_element "//item/description[contains(text(), 'This is the first English version')]"
348
349
    assert_xml_element "//item/description[contains(text(), 'Here is some <b>bold</b> text')]"
    assert_xml_element "//item/description[contains(text(), 'Here is some <b>bold</b> text')]"
349
350
    assert_xml_element "//item/description[contains(text(), 'This is the <span style=\"background: #ffb8b8\">first</span><span style=\"background: #b8ffb8\">second</span> English version')]"
    assert_xml_element "//item/description[contains(text(), 'This is the <span style="background: #ffb8b8">first</span><span style="background: #b8ffb8">second</span> English version')]"
350
351
351
352
    get :history, :page_name => page_name, :locale => 'pt-br', :format => 'xml'
    get :history, :page_name => page_name, :locale => 'pt-br', :format => 'xml'
352
353
    assert_xml_element "//item/description[contains(text(), 'Esta é a primeira versão em português')]"
    assert_xml_element "//item/description[contains(text(), 'Esta é a primeira versão em português')]"
353
354
    assert_xml_element "//item/description[contains(text(), 'Esta é a <span style=\"background: #ffb8b8\">primeira</span><span style=\"background: #b8ffb8\">segunda</span> versão em português')]"
    assert_xml_element "//item/description[contains(text(), 'Esta é a <span style="background: #ffb8b8">primeira</span><span style="background: #b8ffb8">segunda</span> versão em português')]"
354
355
  end
  end
355
356
  
  
356
357
  def test_history_links_to_page_revision
  def test_history_links_to_page_revision
357