Skip to content

Instantly share code, notes, and snippets.

@ricn
Created September 15, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricn/9db349b19374b9b42b36 to your computer and use it in GitHub Desktop.
Save ricn/9db349b19374b9b42b36 to your computer and use it in GitHub Desktop.
Test error:
3) test deletes chosen resource (Bookmarks.BookmarkControllerTest)
test/controllers/bookmark_controller_test.exs:66
** (ArgumentError) argument error
stacktrace:
:erlang.apply(695, :id, [])
test/controllers/bookmark_controller_test.exs:68
Test code:
test "deletes chosen resource", %{conn: conn} do
user = get_session(conn, :current_user)
bookmark = Repo.insert! %Bookmark{href: "http://www.one.com", user_id: user.id}
conn = delete conn, bookmark_path(conn, :delete, bookmark)
assert redirected_to(conn) == bookmark_path(conn, :index)
refute Repo.get(Bookmark, bookmark.id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment