eiri commented on a change in pull request #1085: Return update_seq and offset 
when update_seq is true and keys is set
URL: https://github.com/apache/couchdb/pull/1085#discussion_r161750086
 
 

 ##########
 File path: src/chttpd/test/chttpd_db_test.erl
 ##########
 @@ -187,6 +190,36 @@ should_return_409_for_put_att_nonexistent_rev(Url) ->
     end).
 
 
+should_return_update_seq_when_set_on_all_docs(Url) ->
+    ?_test(begin
+        [create_doc(Url, "testdoc" ++ ?i2l(I)) || I <- lists:seq(1, 3)],
+        {ok, RC, _, RespBody} = test_request:get(Url ++ "/_all_docs/"
+            ++ "?update_seq=true&keys=[\"testdoc1\"]",[?CONTENT_JSON, ?AUTH]),
+        {ResultJson} = ?JSON_DECODE(RespBody),
+        [
+            ?assertNotEqual(undefined,
+                couch_util:get_value(<<"update_seq">>, ResultJson)),
+            ?assertNotEqual(undefined,
+                couch_util:get_value(<<"offset">>, ResultJson))
+        ]
+    end).
+
+
+should_not_return_update_seq_when_unset_on_all_docs(Url) ->
+    ?_test(begin
+        [create_doc(Url, "testdoc" ++ ?i2l(I)) || I <- lists:seq(1, 3)],
+        {ok, RC, _, RespBody} = test_request:get(Url ++ "/_all_docs/"
+            ++ "?update_seq=false&keys=[\"testdoc1\"]",[?CONTENT_JSON, ?AUTH]),
+        {ResultJson} = ?JSON_DECODE(RespBody),
+        [
 
 Review comment:
   Same as above and a side effect is that you might fit macro in a single line.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to