<commit_before><commit_msg>added specs for classroom activity sorter<commit_after>require 'rails_helper'

describe ClassroomActivitySorter do
  let(:activity) { double(:activity, due_date: Date.today - 1.day, created_at: Date.today - 7.days) }
  let(:activity1) { double(:activity, due_date: Date.today, created_at: Date.today - 5.days) }
  let(:activity2) { double(:activity, due_date: nil, created_at: Date.today - 3.days) }
  let(:activity3) { double(:activity, due_date: nil, created_at: Date.today - 1.days) }
  let(:activities) { [activity2, activity1, activity3, activity] }

  it 'should give the activities with due date in sorted by due and without due date in sorted by creation order' do
    expect(described_class.sort(activities)).to eq [activity, activity1, activity2, activity3]
  end
end
{'fraction_non_alphanumeric': 0.1181592039800995, 'fraction_numerical': 0.017412935323383085, 'mean_word_length': 5.338582677165355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6541567', 'n_tokens_mistral': 263, 'n_tokens_neox': 246, 'n_words': 74}