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

  end

  test "PUT allows setting :title and :description", %{conn: conn} do
    {:ok, calendar} = Repo.insert(%Calendar{})

    attrs = %{title: "new title", description: "new description"}
    conn = put conn, calendar_path(conn, :update, calendar), attrs

  end

  test "PUT returns an error if any attributes are invalid", %{conn: conn} do
    {:ok, calendar} = Calendars.create_calendar()

    attrs = %{title: String.duplicate("x", 101)}
    conn = put conn, calendar_path(conn, :update, calendar), attrs
