{"size": 601, "ext": "js", "max_stars_repo_path": "server/test/unit/create-task/createTaskController.test.js", "max_stars_repo_name": "thetoycompany/tdd_task_management_app", "max_stars_repo_stars_event_min_datetime": "2021-08-29T01:16:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-29T01:16:52.000Z", "max_issues_repo_path": "server/test/unit/create-task/createTaskController.test.js", "max_issues_repo_name": "CodingBlackFemales/task-management-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/test/unit/create-task/createTaskController.test.js", "max_forks_repo_name": "CodingBlackFemales/task-management-app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.6315789474, "max_line_length": 85, "alphanum_fraction": 0.6838602329}
import { CreateTaskController } from "../../../src/create-task/createTaskController";
import { CreateTaskCommandSpy } from "../../fixture/createTaskCommandSpy";

describe("The create task controller should", () => {
  const command = new CreateTaskCommandSpy();
  const controller = new CreateTaskController(command);

  it("process a request to add a new task", () => {
    const createTaskRequest = {
      title: "New task title",
      description: "New task description",
      completed: true
    };

    controller.create(createTaskRequest);

    expect(command.wasCalled()).toEqual(1);
  })
})