       insert(:offered_course, term: term1)
       term2_offered_courses = insert_list(4, :offered_course, term: term2)
 
-      expected_offered_courses = preload_associations_for_offered_courses(term2_offered_courses)
       summary_data = Summaries.get_term_offered_course_for_user(coordinator)
 
-      assert summary_data == %{terms: [term2], offered_courses: expected_offered_courses}
+      expected_offered_courses =
+        term2_offered_courses
+        |> preload_associations_for_offered_courses()
+        |> Enum.sort(&(&1.id >= &2.id))
+      summary_data_returned_offered_courses = Enum.sort(summary_data.offered_courses, &(&1.id >= &2.id))
+
+      assert summary_data.terms == [term2]
+      assert expected_offered_courses == summary_data_returned_offered_courses
     end
 
     test "no data returns when every term's end date is passed" do

        |> Repo.preload(:classes)

      student_data = Summaries.get_term_offered_course_for_user(student)
      assert student_data == %{terms: [term2], offered_courses: offered_courses}
    end

    test "when she has multiple courses in multiple terms" do

        insert_list(2, :offered_course, term: term2, teachers: [teacher])
        |> Repo.preload(:classes)

      expected_offered_courses = Enum.sort(offered_courses2, &(&1.id >= &2.id))

      teacher_data = Summaries.get_term_offered_course_for_user(teacher)
      teacher_data_returned_offered_courses = Enum.sort(teacher_data.offered_courses, &(&1.id >= &2.id))

      assert teacher_data.terms == [term2]
      assert teacher_data_returned_offered_courses == expected_offered_courses
    end

    test "when she has multiple courses the end_date of all terms are passed" do
