fix tests

This commit is contained in:
r888888888
2016-05-26 13:17:18 -07:00
parent 30415d9e1e
commit 110569708e
6 changed files with 14 additions and 19 deletions

View File

@@ -42,9 +42,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
should "handle errors gracefully" do
@req.stubs(:update_forum_topic_for_approve).raises(RuntimeError.new("blah"))
assert_difference("Dmail.count", 1) do
CurrentUser.scoped(@admin, "127.0.0.1") do
@req.approve!
end
@req.approve!(@admin.id)
end
assert_match(/Exception: RuntimeError/, Dmail.last.body)
assert_match(/Message: blah/, Dmail.last.body)
@@ -56,9 +54,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
should "update the topic when processed" do
assert_difference("ForumPost.count") do
CurrentUser.scoped(@admin, "127.0.0.1") do
@req.approve!
end
@req.approve!(@admin.id)
end
end