Add categories properly

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-15 12:04:09 +01:00
parent 9df9a795c7
commit 8b4d1ab4e4
6 changed files with 23 additions and 13 deletions

View File

@@ -30,6 +30,9 @@ defmodule EventosWeb.EventControllerTest do
describe "create event" do
test "renders event when data is valid", %{conn: conn, user: user} do
attrs = Map.put(@create_attrs, :organizer_id, user.account.id)
category = insert(:category)
attrs = Map.put(attrs, :category_id, category.id)
conn = auth_conn(conn, user)
conn = post conn, event_path(conn, :create), event: attrs
assert %{"id" => id} = json_response(conn, 201)["data"]