course_test.rb 402 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2 3
require 'test_helper'

class CourseTest < ActiveSupport::TestCase
4 5
  test 'fails with improper data' do
    assert_raise do
6
      Course.create! course_number: nil, subject: nil
7 8 9 10
    end
  end

  test 'creates with proper data' do
11
    Course.create! course_number: '112', subject: 'CS'
12 13 14
  end

  test 'has correct number of sections' do
15
    assert_equal 3, courses(:cs112).course_sections.count
16
  end
Zac Wood's avatar
Zac Wood committed
17
end