diff --git a/test/unit/course_test.rb b/test/unit/course_test.rb index a29501066..86963eb4b 100644 --- a/test/unit/course_test.rb +++ b/test/unit/course_test.rb @@ -7,8 +7,8 @@ class CourseTest < ActiveSupport::TestCase end test 'name valid with CJK coding' do - course = Course.find_by_id(74) name_quirk = '电路与电子学基础(软件工程专业)' + course = Course.find_by_id(74) course.name = "test_course" assert course.valid? course.name = name_quirk @@ -17,9 +17,9 @@ class CourseTest < ActiveSupport::TestCase test 'description too long must be valid.' do course = Course.find_by_id(8) - course.description = course.description * 100 + course.description = 'a' * 2048 # description length validate. course.valid? - assert_equal course.errors.full_messages.count, 0 + assert course.errors[:name].empty? assert course.valid? end