     Phoenix.ConnTest.build_conn()
     |> assign(:current_user, user)
   end
+
   #test "unauthenticated request", %{conn: conn} do
   #  conn = get conn, calendar_path(conn, :index)
   #  IO.inspect conn

    end
  end

  @tag user_role: :coordinator
  test "returns classes in the requested week for coordinator even when my_classes is true", %{conn: conn} do
    create_test_data()

    expected_result =
      %{"classes" => [%{"classroom" => "r101",
                        "date" => "2017-01-01",
                        "finishes_at" => "12:00:00",
                        "starting_at" => "10:00:00",
                        "course_name" => "english",
                        "teachers" => [%{"family_name" => "tf1",
                                         "nickname" => "tn1",
                                         "name" => "t1"}],
                        "term_name" => "term1"}]}

    params = %{date: "2017-01-01", my_classes: "true"}
    conn = get conn, calendar_path(conn, :index), params
    assert json_response(conn, 200) == expected_result
  end

  @tag user_role: :volunteer
  test "returns classes in the requested week for volunteer even when my_classes is true", %{conn: conn} do
    create_test_data()

    expected_result =
      %{"classes" => [%{"classroom" => "r101",
                        "date" => "2017-01-01",
                        "finishes_at" => "12:00:00",
                        "starting_at" => "10:00:00",
                        "course_name" => "english",
                        "teachers" => [%{"family_name" => "tf1",
                                         "nickname" => "tn1",
                                         "name" => "t1"}],
                        "term_name" => "term1"}]}

    params = %{date: "2017-01-01", my_classes: "true"}
    conn = get conn, calendar_path(conn, :index), params
    assert json_response(conn, 200) == expected_result
  end

  describe "when requested by a teacher calendar returns:" do
    @tag user_role: :teacher
    test "empty if the teacher has no class in the requested week", %{conn: _conn} do
      test_data = create_test_data()

    end
  end

  describe "when requested by a student, calendar returns:" do
    @tag user_role: :student
    test "empty when no class in the requested week", %{conn: _conn} do
      test_data = create_test_data()
