test.course.model

This commit is contained in:
yanxd 2014-07-18 15:57:18 +08:00
parent 5087f90a26
commit 3f6a298eb4
1 changed files with 3 additions and 3 deletions

View File

@ -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