+
+ assert_raise(ActiveRecord::RecordNotFound) { User.find(0) }
+ message.from_user_id = 0
+ message.to_user_id = 0
+ assert_raise(ActiveRecord::RecordInvalid) {message.save!}
+ end
+
+ def test_utf8_roundtrip
+ (1..255).each do |i|
+ assert_message_ok('c', i)
+ assert_message_ok(EURO, i)
+ end
+ end
+
+ def test_length_oversize
+ assert_raise(ActiveRecord::RecordInvalid) { make_message('c', 256).save! }
+ assert_raise(ActiveRecord::RecordInvalid) { make_message(EURO, 256).save! }