course_test.rb 422 B

1234567891011121314151617181920212223
  1. require 'test_helper'
  2. class CourseTest < ActiveSupport::TestCase
  3. def setup
  4. @course = courses(:one)
  5. end
  6. test "should be valid" do
  7. assert @course.valid?
  8. end
  9. test "name should be present" do
  10. @course.name = " "
  11. assert_not @course.valid?
  12. end
  13. test "dates should be in order" do
  14. @course.starts_on = 1.days.ago
  15. @course.ends_on = 2.days.ago
  16. assert_not @course.valid?
  17. end
  18. end