   end
 
   test "PUT allows setting :title and :description", %{conn: conn} do
-    {:ok, calendar} = Repo.insert(%Calendar{})
+    {:ok, calendar} = Calendars.create_calendar()
 
     attrs = %{title: "new title", description: "new description"}
     conn = put conn, calendar_path(conn, :update, calendar), attrs

  use CalgyApi.ConnCase

  alias Plug.Conn
  alias Calgy.Calendars.Calendar
  alias Calgy.Repo

  setup %{conn: conn} do
    conn =
      conn
      |> put_req_header("accept", "application/json")

    {:ok, %{conn: conn}}
  end


  end

  test "GET shows information about a calendar", %{conn: conn} do
    {:ok, calendar} = Calendars.create_calendar()
    conn = get conn, calendar_path(conn, :show, calendar)
    body = json_response(conn, 200)

