1 require File.dirname(__FILE__) + '/../test_helper'
3 class MessageTest < Test::Unit::TestCase
4 fixtures :messages, :users
6 # This needs to be updated when new fixtures are added
8 def test_check_message_count
9 assert_equal 2, Message.count
12 def test_check_empty_message_fails
14 assert !message.valid?
15 assert message.errors.invalid?(:title)
16 assert message.errors.invalid?(:body)
17 assert message.errors.invalid?(:sent_on)
18 assert true, message.message_read
21 def test_validating_msgs
22 message = messages(:one)
24 massage = messages(:two)
28 def test_invalid_send_recipient
29 message = messages(:one)
31 message.recipient = nil
32 assert !message.valid?