From 39ace2d0fa0d3700566bbc453b6518b0a6ff83c3 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Wed, 5 Aug 2009 18:11:45 +0000 Subject: proper handling of 406 Not Acceptable errors in list and show functions git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@801345 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/show_documents.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'share/www') diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js index 7181a926..59bcd6d3 100644 --- a/share/www/script/test/show_documents.js +++ b/share/www/script/test/show_documents.js @@ -318,13 +318,12 @@ couchTests.show_documents = function(debug) { // test the provides mime matcher without a match xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, { headers: { - "Accept": 'text/html,application/atom+xml; q=0.9' + "Accept": 'text/monkeys' } }); - var ct = xhr.getResponseHeader("Content-Type"); - T(/charset=utf-8/.test(ct)) - T(/text\/html/.test(ct)) - T(xhr.responseText == "Ha ha, you said \"plankton\"."); + var rs = JSON.parse(xhr.responseText); + T(rs.error == "not_acceptable") + // should fallback on the first one xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, { -- cgit v1.2.3