Skip to content

Instantly share code, notes, and snippets.

@mzemel
Created October 15, 2015 17:35
Show Gist options
  • Save mzemel/04861157d971696f7630 to your computer and use it in GitHub Desktop.
Save mzemel/04861157d971696f7630 to your computer and use it in GitHub Desktop.
test "/index returns a list of contacts" do
contacts_as_json =
%Contact{name: "Gumbo", phone: "(801) 555-5555"}
|> Repo.insert
|> List.wrap
|> Poison.encode!
response = conn(:get, "/api/contacts") |> send_request
assert response.status == 200
assert response.resp_body == contacts_as_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment