   end
 
   test "updates chosen resource and redirects when data is valid", %{conn: conn} do
-    task = Repo.insert! %Task{}
+    task = insert(:task)
     conn = put conn, task_path(conn, :update, task), task: @valid_attrs
     assert redirected_to(conn) == task_path(conn, :show, task)
     assert Repo.get_by(Task, @valid_attrs)

    teacher_conn = login_as(:teacher)
    volunteer_conn = login_as(:volunteer)

    task = Repo.insert! %Task{}

    conn = delete student_conn, task_path(student_conn, :delete, task)
    assert html_response(conn, 403)

    teacher_conn = login_as(:teacher)
    volunteer_conn = login_as(:volunteer)

    task = insert(:task)

    conn = put student_conn, task_path(student_conn, :update, task), task: @valid_attrs
    assert html_response(conn, 403)
