aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2014-08-14 23:33:40 +0000
committerAbdelkader Boudih <terminale@gmail.com>2014-08-17 23:09:42 +0000
commit6a2ca149fda46c8a36d80e0f95affb1b6de11aae (patch)
treed7d2b9f6f59eeacd6ac7b59a9e9ee8a804eabb94 /actionmailer
parentcf75464d26687b876335d116e0ce69d95fa3eb3b (diff)
downloadrails-6a2ca149fda46c8a36d80e0f95affb1b6de11aae.tar.gz
rails-6a2ca149fda46c8a36d80e0f95affb1b6de11aae.tar.bz2
rails-6a2ca149fda46c8a36d80e0f95affb1b6de11aae.zip
[ActiveJob] Fix test syntax
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/test/message_delivery_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/actionmailer/test/message_delivery_test.rb b/actionmailer/test/message_delivery_test.rb
index 6ad9b099a3..49958081f5 100644
--- a/actionmailer/test/message_delivery_test.rb
+++ b/actionmailer/test/message_delivery_test.rb
@@ -11,7 +11,7 @@ class MessageDeliveryTest < ActiveSupport::TestCase
@previous_logger = ActiveJob::Base.logger
@previous_delivery_method = ActionMailer::Base.delivery_method
ActionMailer::Base.delivery_method = :test
- ActiveJob::Base.logger = Logger.new('/dev/null')
+ ActiveJob::Base.logger = Logger.new(nil)
@mail = DelayedMailer.test_message(1, 2, 3)
ActionMailer::Base.deliveries.clear
end
@@ -21,12 +21,12 @@ class MessageDeliveryTest < ActiveSupport::TestCase
ActionMailer::Base.delivery_method = @previous_delivery_method
end
- test 'should be a MessageDelivery' do
- assert_equal @mail.class, ActionMailer::MessageDelivery
+ test 'should have a message' do
+ assert @mail.message
end
- test 'its object should be a Mail::Message' do
- assert_equal @mail.__getobj__.class, Mail::Message
+ test 'its message should be a Mail::Message' do
+ assert_equal Mail::Message , @mail.message.class
end
test 'should respond to .deliver' do
@@ -47,28 +47,28 @@ class MessageDeliveryTest < ActiveSupport::TestCase
test 'should enqueue and run correctly in activejob' do
@mail.deliver_later!
- assert_equal ActionMailer::Base.deliveries.size, 1
+ assert_equal 1 , ActionMailer::Base.deliveries.size
end
test 'should enqueue the email with :deliver delivery method' do
ret = ActionMailer::DelayedDeliveryJob.stub :enqueue, ->(*args){ args } do
@mail.deliver_later
end
- assert_equal ret, ["DelayedMailer", "test_message", "deliver", 1, 2, 3]
+ assert_equal ['DelayedMailer', 'test_message', 'deliver', 1, 2, 3], ret
end
test 'should enqueue the email with :deliver! delivery method' do
ret = ActionMailer::DelayedDeliveryJob.stub :enqueue, ->(*args){ args } do
@mail.deliver_later!
end
- assert_equal ret, ["DelayedMailer", "test_message", "deliver!", 1, 2, 3]
+ assert_equal ['DelayedMailer', 'test_message', 'deliver!', 1, 2, 3], ret
end
test 'should enqueue a delivery with a delay' do
ret = ActionMailer::DelayedDeliveryJob.stub :enqueue_in, ->(*args){ args } do
@mail.deliver_later in: 600
end
- assert_equal ret, [600, "DelayedMailer", "test_message", "deliver", 1, 2, 3]
+ assert_equal [600, 'DelayedMailer', 'test_message', 'deliver', 1, 2, 3], ret
end
test 'should enqueue a delivery at a specific time' do
@@ -76,7 +76,7 @@ class MessageDeliveryTest < ActiveSupport::TestCase
ret = ActionMailer::DelayedDeliveryJob.stub :enqueue_at, ->(*args){ args } do
@mail.deliver_later at: later_time
end
- assert_equal ret, [later_time, "DelayedMailer", "test_message", "deliver", 1, 2, 3]
+ assert_equal [later_time, 'DelayedMailer', 'test_message', 'deliver', 1, 2, 3], ret
end
end