]> git.openstreetmap.org Git - rails.git/blob - test/unit/message_test.rb
Starting to test the output of the xml to make sure that it is what we expect to...
[rails.git] / test / unit / message_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2
3 class MessageTest < Test::Unit::TestCase
4   fixtures :messages, :users
5
6   # This needs to be updated when new fixtures are added
7   # or removed.
8   def test_check_message_count
9     assert_equal 2, Message.count
10   end
11
12   def test_check_empty_message_fails
13     message = Message.new
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
19   end
20   
21   def test_validating_msgs
22     message = messages(:one)
23     assert message.valid?
24     massage = messages(:two)
25     assert message.valid?
26   end
27   
28   def test_invalid_send_recipient
29     message = messages(:one)
30     message.sender = nil
31     message.recipient = nil
32     assert !message.valid?
33   end
34 end