Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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