message_test.rb 447 B

12345678910111213141516171819202122
  1. require 'test_helper'
  2. class MessageTest < ActiveSupport::TestCase
  3. def setup
  4. @message = messages(:one)
  5. end
  6. test "should be valid" do
  7. assert @message.valid?
  8. end
  9. test "content should be present" do
  10. @message.content = " "
  11. assert_not @message.valid?
  12. end
  13. test "should destroy messages on conversation destroy" do
  14. assert_difference "Message.all.count", -2 do
  15. conversations(:one).destroy
  16. end
  17. end
  18. end