update forum topic when alias/implication/update request is updated

This commit is contained in:
r888888888
2015-02-15 12:51:02 -08:00
parent b524c2dfba
commit 387dece55a
8 changed files with 142 additions and 4 deletions

View File

@@ -15,5 +15,27 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
BulkUpdateRequest.create(:title => "abc", :reason => "zzz", :script => "create alias aaa -> bbb")
end
end
context "with an associated forum topic" do
setup do
@admin = FactoryGirl.create(:admin_user)
@topic = FactoryGirl.create(:forum_topic)
@req = FactoryGirl.create(:bulk_update_request, :script => "create alias aaa -> bbb", :forum_topic => @topic)
end
should "update the topic when processed" do
assert_difference("ForumPost.count") do
CurrentUser.scoped(@admin, "127.0.0.1") do
@req.approve!
end
end
end
should "update the topic when rejected" do
assert_difference("ForumPost.count") do
@req.reject!
end
end
end
end
end