<commit_before>require 'rails_helper'

RSpec.describe Course, type: :model do
  before do
    @course = FactoryGirl.build(:course, department: "EECS", course_number: 132)
    @course.course_instances = [FactoryGirl.build(:course_instance, :end_date => Date.today-1), FactoryGirl.build(:course_instance, :end_date=>Date.today+365)]
    #Testing unhappy paths
    @course_bad = FactoryGirl.build(:course, department: 132, course_number: "EECS")
  end

  describe ".postrequisites" do
    it "should return all prerequisites for the course" do
      prereq = FactoryGirl.create(:course, department: "EECS", course_number: 233)
      postreq = FactoryGirl.create(:course, department: "EECS", course_number: 131 )
      FactoryGirl.create(:prerequisite, postrequisite: postreq, prerequisite_ids: [prereq.id])
      expect(prereq.postrequisites).to eq [postreq]
    end
  end

  describe ".prerequisites" do
    it "" do
      postreq = FactoryGirl.create(:course, department: "EECS", course_number: 131)<commit_msg>Filling in a test description Andrew noticed I missed.<commit_after>require 'rails_helper'

RSpec.describe Course, type: :model do
  before do
    @course = FactoryGirl.build(:course, department: "EECS", course_number: 132)
    @course.course_instances = [FactoryGirl.build(:course_instance, :end_date => Date.today-1), FactoryGirl.build(:course_instance, :end_date=>Date.today+365)]
    #Testing unhappy paths
    @course_bad = FactoryGirl.build(:course, department: 132, course_number: "EECS")
  end

  describe ".postrequisites" do
    it "should return all postrequisites for the course" do
      prereq = FactoryGirl.create(:course, department: "EECS", course_number: 233)
      postreq = FactoryGirl.create(:course, department: "EECS", course_number: 131 )
      FactoryGirl.create(:prerequisite, postrequisite: postreq, prerequisite_ids: [prereq.id])
      expect(prereq.postrequisites).to eq [postreq]
    end
  end

  describe ".prerequisites" do
    it "should return all prerequisites for the course" do
      postreq = FactoryGirl.create(:course, department: "EECS", course_number: 131)
{'fraction_non_alphanumeric': 0.11432637571157495, 'fraction_numerical': 0.018026565464895637, 'mean_word_length': 4.8259668508287294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7119476', 'n_tokens_mistral': 711, 'n_tokens_neox': 630, 'n_words': 166}