         |> Repo.preload(:classes)
 
       summary_data = Summaries.get_term_offered_course_for_user(coordinator)
-      assert summary_data == %{terms: [term1, term2], offered_courses: [term2_offered_course]}
+
+      expected_terms = Enum.sort([term1, term2], &(&1.id >= &2.id))
+      summary_data_returned_terms = Enum.sort(summary_data.terms, &(&1.id >= &2.id))
+
+      assert summary_data_returned_terms == expected_terms
+      assert summary_data.offered_courses == [term2_offered_course]
     end
 
     test "when each term has offered_courses" do

      terms = insert_list(2, :term)
      summary_data = Summaries.get_term_offered_course_for_user(coordinator)

      assert summary_data == %{terms: terms, offered_courses: []}
    end

    test "when only one term has offered_course" do

        |> Repo.preload(:classes)
      term2_offered_courses = insert_list(4, :offered_course, term: term2)

      summary_data = Summaries.get_term_offered_course_for_user(coordinator)

      expected_offered_courses =
        [term1_offered_course | term2_offered_courses]
        |> preload_associations_for_offered_courses()
        |> Enum.sort(&(&1.id >= &2.id))
      expected_terms = Enum.sort([term1, term2], &(&1.id >= &2.id))

      summary_data_returned_terms = Enum.sort(summary_data.terms, &(&1.id >= &2.id))
      summary_data_returned_offered_courses = Enum.sort(summary_data.offered_courses, &(&1.id >= &2.id))

      assert summary_data_returned_terms == expected_terms
      assert expected_offered_courses == summary_data_returned_offered_courses
    end

    test "when term end time is past all it's data will be excluded" do
