Skip to content

Commit

Permalink
refactor tests, remove redundant test data files
Browse files Browse the repository at this point in the history
  • Loading branch information
boonious committed Oct 5, 2018
1 parent 4e8e18c commit edad1c6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion test/data/commit.json

This file was deleted.

1 change: 0 additions & 1 deletion test/data/commit.xml

This file was deleted.

4 changes: 2 additions & 2 deletions test/struct_update_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule HuiStructUpdateLiveTest do
x = %Hui.U{doc: doc_map}

Hui.Request.update(url, x)
Hui.Request.update(url, File.read!("./test/data/commit.json"))
Hui.Request.update(url, "{\"commit\":{}}")

verify_docs_exist(:default, ["tt0083658"])
end
Expand Down Expand Up @@ -64,7 +64,7 @@ defmodule HuiStructUpdateLiveTest do
x = %Hui.U{doc: [doc_map1, doc_map2]}

Hui.Request.update(url, x)
Hui.Request.update(url, File.read!("./test/data/commit.json"))
Hui.Request.update(url, "{\"commit\":{}}")

verify_docs_exist(:default, ["tt1316540", "tt1650453"])
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ defmodule TestHelpers do
def delete_verify_doc_deletion(%Hui.URL{} = url, delete_msg, id) when is_binary(delete_msg) do
# change the following update calls from binary to struct-based later when 'delete', 'commit' ops exist
Hui.Request.update(url, delete_msg)
Hui.Request.update(url, File.read!("./test/data/commit.json"))
Hui.Request.update(url, "{\"commit\":{}}")
ids = if is_list(id), do: Enum.join(id, " OR "), else: id
resp = Hui.search!(:default, q: "*", fq: ["id:#{ids}"])
assert resp.body["response"]["numFound"] == 0
Expand Down

0 comments on commit edad1c6

Please sign in to comment.