test/unit/message_test.rb in has_messages-0.3.1 vs test/unit/message_test.rb in has_messages-0.4.0
- old
+ new
@@ -1,8 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
-class MessageByDefaultTest < Test::Unit::TestCase
+class MessageByDefaultTest < ActiveSupport::TestCase
def setup
@message = Message.new
end
def test_should_not_have_a_sender
@@ -25,11 +25,11 @@
assert_nil @message.hidden_at
assert !@message.hidden?
end
end
-class MessageTest < Test::Unit::TestCase
+class MessageTest < ActiveSupport::TestCase
def test_should_be_valid_with_a_set_of_valid_attributes
message = new_message
assert message.valid?
end
@@ -86,11 +86,11 @@
assert_equal 'unsent', message.state
assert_nil message.hidden_at
end
end
-class MessageBeforeBeingCreatedTest < Test::Unit::TestCase
+class MessageBeforeBeingCreatedTest < ActiveSupport::TestCase
def setup
@message = new_message
end
def test_should_not_have_any_recipients
@@ -126,11 +126,11 @@
@message.bcc(user)
assert_equal [user], @message.bcc
end
end
-class MesageAfterBeingCreatedTest < Test::Unit::TestCase
+class MesageAfterBeingCreatedTest < ActiveSupport::TestCase
def setup
@message = create_message
end
def test_should_record_when_it_was_created
@@ -174,11 +174,11 @@
@message.bcc(user)
assert_equal [user], @message.bcc
end
end
-class MessageWithoutRecipientsTest < Test::Unit::TestCase
+class MessageWithoutRecipientsTest < ActiveSupport::TestCase
def setup
@message = create_message
end
def test_should_not_be_able_to_queue
@@ -188,11 +188,11 @@
def test_should_not_be_able_to_deliver
assert !@message.deliver
end
end
-class MessageWithRecipientsTest < Test::Unit::TestCase
+class MessageWithRecipientsTest < ActiveSupport::TestCase
def setup
@erich = create_user(:login => 'Erich')
@richard = create_user(:login => 'Richard')
@ralph = create_user(:login => 'Ralph')
@message = create_message(
@@ -225,11 +225,11 @@
def test_should_be_able_to_deliver
assert @message.deliver
end
end
-class MessageQueuedTest < Test::Unit::TestCase
+class MessageQueuedTest < ActiveSupport::TestCase
def setup
@message = create_message(:to => create_user(:login => 'coward'))
@message.queue
end
@@ -244,11 +244,11 @@
def test_should_be_able_to_deliver
assert @message.deliver
end
end
-class MessageDeliveredTest < Test::Unit::TestCase
+class MessageDeliveredTest < ActiveSupport::TestCase
def setup
@message = create_message(:to => create_user(:login => 'coward'))
@message.deliver
end
@@ -263,11 +263,11 @@
def test_should_not_be_able_to_deliver
assert !@message.deliver
end
end
-class MessageHiddenTest < Test::Unit::TestCase
+class MessageHiddenTest < ActiveSupport::TestCase
def setup
@message = create_message
@message.hide
end
@@ -282,11 +282,11 @@
def test_should_not_be_visible
assert !@message.visible?
end
end
-class MessageUnhiddenTest < Test::Unit::TestCase
+class MessageUnhiddenTest < ActiveSupport::TestCase
def setup
@message = create_message
@message.hide
@message.unhide
end
@@ -302,11 +302,11 @@
def test_should_be_visible
assert @message.visible?
end
end
-class MessageForwardedTest < Test::Unit::TestCase
+class MessageForwardedTest < ActiveSupport::TestCase
def setup
@admin = create_user(:login => 'admin')
original_message = create_message(
:subject => 'Hello',
:body => 'How are you?',
@@ -349,11 +349,11 @@
def test_should_not_include_bcc_recipients
assert @message.bcc.empty?
end
end
-class MessageRepliedTest < Test::Unit::TestCase
+class MessageRepliedTest < ActiveSupport::TestCase
def setup
@admin = create_user(:login => 'admin')
@erich = create_user(:login => 'Erich')
@richard = create_user(:login => 'Richard')
@ralph = create_user(:login => 'Ralph')
@@ -400,11 +400,11 @@
def test_should_not_include_bcc_recipients
assert @message.bcc.empty?
end
end
-class MessageRepliedToAllTest < Test::Unit::TestCase
+class MessageRepliedToAllTest < ActiveSupport::TestCase
def setup
@admin = create_user(:login => 'admin')
@erich = create_user(:login => 'Erich')
@richard = create_user(:login => 'Richard')
@ralph = create_user(:login => 'Ralph')
@@ -451,10 +451,10 @@
def test_should_use_same_bcc_recipients
assert_equal [@ralph], @message.bcc
end
end
-class MessageAsAClassTest < Test::Unit::TestCase
+class MessageAsAClassTest < ActiveSupport::TestCase
def setup
@hidden_message = create_message(:hidden_at => Time.now)
@visible_message = create_message
end