From 01c35c817528cc54c8c28f56786e92ff292e3c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Mon, 9 Apr 2007 15:33:38 +0000 Subject: Removed ill faded xml_node class from codebase. Use XmlSimple instead git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/webservice_test.rb | 60 ++------------------------- 1 file changed, 3 insertions(+), 57 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/webservice_test.rb b/actionpack/test/controller/webservice_test.rb index 2b50088bb4..4558d401b0 100644 --- a/actionpack/test/controller/webservice_test.rb +++ b/actionpack/test/controller/webservice_test.rb @@ -41,7 +41,7 @@ class WebServiceTest < Test::Unit::TestCase def setup @controller = TestController.new ActionController::Base.param_parsers.clear - ActionController::Base.param_parsers[Mime::XML] = :xml_node + ActionController::Base.param_parsers[Mime::XML] = :xml_simple end def test_check_parameters @@ -54,7 +54,7 @@ class WebServiceTest < Test::Unit::TestCase assert_equal 'entry', @controller.response.body assert @controller.params.has_key?(:entry) - assert_equal 'content...', @controller.params["entry"].summary.node_value + assert_equal 'content...', @controller.params["entry"]['summary'] assert_equal 'true', @controller.params["entry"]['attributed'] end @@ -63,7 +63,7 @@ class WebServiceTest < Test::Unit::TestCase assert_equal 'entry', @controller.response.body assert @controller.params.has_key?(:entry) - assert_equal 'content...', @controller.params["entry"].summary.node_value + assert_equal 'content...', @controller.params["entry"]['summary'] assert_equal 'true', @controller.params["entry"]['attributed'] end @@ -183,57 +183,3 @@ class WebServiceTest < Test::Unit::TestCase end end - - -class XmlNodeTest < Test::Unit::TestCase - def test_all - xn = XmlNode.from_xml(%{ - - - With O'Reilly and Adaptive Path - - - Staying at the Savoy - - - - - - - - - } - ) - assert_equal 'UTF-8', xn.node.document.encoding - assert_equal '1.0', xn.node.document.version - assert_equal 'true', xn['success'] - assert_equal 'response', xn.node_name - assert_equal 'Ajax Summit', xn.page['title'] - assert_equal '1133', xn.page['id'] - assert_equal "With O'Reilly and Adaptive Path", xn.page.description.node_value - assert_equal nil, xn.nonexistent - assert_equal "Staying at the Savoy", xn.page.notes.note.node_value.strip - assert_equal 'Technology', xn.page.tags.tag[0]['name'] - assert_equal 'Travel', xn.page.tags.tag[1][:name] - matches = xn.xpath('//@id').map{ |id| id.to_i } - assert_equal [4, 5, 1020, 1133], matches.sort - matches = xn.xpath('//tag').map{ |tag| tag['name'] } - assert_equal ['Technology', 'Travel'], matches.sort - assert_equal "Ajax Summit", xn.page['title'] - xn.page['title'] = 'Ajax Summit V2' - assert_equal "Ajax Summit V2", xn.page['title'] - assert_equal "Staying at the Savoy", xn.page.notes.note.node_value.strip - xn.page.notes.note.node_value = "Staying at the Ritz" - assert_equal "Staying at the Ritz", xn.page.notes.note.node_value.strip - assert_equal '5', xn.page.tags.tag[1][:id] - xn.page.tags.tag[1]['id'] = '7' - assert_equal '7', xn.page.tags.tag[1]['id'] - end - - - def test_small_entry - node = XmlNode.from_xml('hi') - assert_equal 'hi', node.node_value - end - -end -- cgit v1.2.3