course_section_test.rb 470 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2
require 'test_helper'

Zac Wood's avatar
Zac Wood committed
3
class CourseSectionTest < ActiveSupport::TestCase
4 5
  test 'fails with improper data' do
    assert_raise do
Zac Wood's avatar
Zac Wood committed
6
      CourseSection.create! name: nil,
7
                      crn: nil,
8
                      title: nil
9 10 11 12
    end
  end

  test 'succeeds with proper data' do
Zac Wood's avatar
Zac Wood committed
13
    CourseSection.create! name: 'Test section',
14 15
                    crn: '12345',
                    title: 'Test title',
16
                    course_id: courses(:cs211).id
17
  end
Zac Wood's avatar
Zac Wood committed
18
end