summaryrefslogtreecommitdiff
path: root/test/xmlrpc/test_client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/xmlrpc/test_client.rb')
-rw-r--r--test/xmlrpc/test_client.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/xmlrpc/test_client.rb b/test/xmlrpc/test_client.rb
index a509aec0c4f..d0e47b17d68 100644
--- a/test/xmlrpc/test_client.rb
+++ b/test/xmlrpc/test_client.rb
@@ -188,7 +188,7 @@ module XMLRPC
rest.each { |x| refute x }
end
- def test_bad_content_type
+ def test_request
fh = read 'blog.xml'
responses = {
@@ -210,6 +210,29 @@ module XMLRPC
assert_equal expected, resp
end
+ # make a request without content-type header
+ def test_bad_content_type
+ fh = read 'blog.xml'
+
+ responses = {
+ '/foo' => [ Fake::Response.new(fh) ]
+ }
+
+ client = fake_client(responses).new2 'http://example.org/foo'
+
+ resp = client.call('wp.getUsersBlogs', 'tlo', 'omg')
+
+ expected = [{
+ "isAdmin" => true,
+ "url" => "http://tenderlovemaking.com/",
+ "blogid" => "1",
+ "blogName" => "Tender Lovemaking",
+ "xmlrpc" => "http://tenderlovemaking.com/xmlrpc.php"
+ }]
+
+ assert_equal expected, resp
+ end
+
private
def read filename
File.read File.expand_path(File.join(__FILE__, '..', 'data', filename))