diff options
author | Garren Smith <garren.smith@gmail.com> | 2020-05-06 15:09:17 +0200 |
---|---|---|
committer | garren smith <garren.smith@gmail.com> | 2020-05-08 07:45:22 +0200 |
commit | d66e95afef1b25d13bad21e5597ef5a17209628a (patch) | |
tree | 99be016a2abef7bfcbab4f748dfa33410364a846 | |
parent | b2f2a45122cd1d0315ef20068bf38ef2ec4afc71 (diff) | |
download | couchdb-d66e95afef1b25d13bad21e5597ef5a17209628a.tar.gz |
mix format all_docs_test.exs
-rw-r--r-- | test/elixir/test/all_docs_test.exs | 123 |
1 files changed, 65 insertions, 58 deletions
diff --git a/test/elixir/test/all_docs_test.exs b/test/elixir/test/all_docs_test.exs index 46ab1f8b3..21c136d39 100644 --- a/test/elixir/test/all_docs_test.exs +++ b/test/elixir/test/all_docs_test.exs @@ -188,34 +188,36 @@ defmodule AllDocsTest do test "GET with one key", context do db_name = context[:db_name] - {:ok, _} = create_doc( - db_name, - %{ - _id: "foo", - bar: "baz" - } - ) + {:ok, _} = + create_doc( + db_name, + %{ + _id: "foo", + bar: "baz" + } + ) - {:ok, _} = create_doc( - db_name, - %{ - _id: "foo2", - bar: "baz2" - } - ) + {:ok, _} = + create_doc( + db_name, + %{ + _id: "foo2", + bar: "baz2" + } + ) - resp = Couch.get( - "/#{db_name}/_all_docs", - query: %{ - :key => "\"foo\"", - } - ) + resp = + Couch.get( + "/#{db_name}/_all_docs", + query: %{ + :key => "\"foo\"" + } + ) assert resp.status_code == 200 assert length(Map.get(resp, :body)["rows"]) == 1 end - @tag :with_db test "POST with empty body", context do db_name = context[:db_name] @@ -223,10 +225,11 @@ defmodule AllDocsTest do resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: create_docs(0..2)}) assert resp.status_code in [201, 202] - resp = Couch.post( - "/#{db_name}/_all_docs", - body: %{} - ) + resp = + Couch.post( + "/#{db_name}/_all_docs", + body: %{} + ) assert resp.status_code == 200 assert length(Map.get(resp, :body)["rows"]) == 3 @@ -239,12 +242,13 @@ defmodule AllDocsTest do resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: create_docs(0..3)}) assert resp.status_code in [201, 202] - resp = Couch.post( - "/#{db_name}/_all_docs", - body: %{ - :keys => [1] - } - ) + resp = + Couch.post( + "/#{db_name}/_all_docs", + body: %{ + :keys => [1] + } + ) assert resp.status_code == 200 rows = resp.body["rows"] @@ -259,14 +263,15 @@ defmodule AllDocsTest do resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: create_docs(0..3)}) assert resp.status_code in [201, 202] - resp = Couch.post( - "/#{db_name}/_all_docs", - body: %{ - :keys => ["1", "2"], - :limit => 1, - :include_docs => true - } - ) + resp = + Couch.post( + "/#{db_name}/_all_docs", + body: %{ + :keys => ["1", "2"], + :limit => 1, + :include_docs => true + } + ) assert resp.status_code == 200 rows = resp.body["rows"] @@ -346,15 +351,16 @@ defmodule AllDocsTest do resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: create_docs(0..3)}) assert resp.status_code in [201, 202] - resp = Couch.post( - "/#{db_name}/_all_docs", - query: %{ - :limit => 1 - }, - body: %{ - :keys => [1, 2] - } - ) + resp = + Couch.post( + "/#{db_name}/_all_docs", + query: %{ + :limit => 1 + }, + body: %{ + :keys => [1, 2] + } + ) assert resp.status_code == 200 assert length(Map.get(resp, :body)["rows"]) == 1 @@ -367,16 +373,17 @@ defmodule AllDocsTest do resp = Couch.post("/#{db_name}/_bulk_docs", body: %{docs: create_docs(0..3)}) assert resp.status_code in [201, 202] - resp = Couch.post( - "/#{db_name}/_all_docs", - query: %{ - :limit => 1 - }, - body: %{ - :keys => [1, 2], - :limit => 2 - } - ) + resp = + Couch.post( + "/#{db_name}/_all_docs", + query: %{ + :limit => 1 + }, + body: %{ + :keys => [1, 2], + :limit => 2 + } + ) assert resp.status_code == 200 assert length(Map.get(resp, :body)["rows"]) == 1 |