fixes #2885: "Is Deleted" not being recorded correctly for Wiki Page Versions

This commit is contained in:
r888888888
2017-02-15 15:32:41 -08:00
parent f374eec4a1
commit 291e9acdc7
2 changed files with 13 additions and 2 deletions

View File

@@ -112,13 +112,24 @@ class WikiPagesControllerTest < ActionController::TestCase
context "destroy action" do
setup do
@wiki_page = FactoryGirl.create(:wiki_page)
@mod = FactoryGirl.create(:mod_user)
end
should "destroy a wiki_page" do
post :destroy, {:id => @wiki_page.id}, {:user_id => @mod.id}
CurrentUser.scoped(@mod) do
post :destroy, {:id => @wiki_page.id}, {:user_id => @mod.id}
end
@wiki_page.reload
assert_equal(true, @wiki_page.is_deleted?)
end
should "record the deleter" do
CurrentUser.scoped(@mod) do
post :destroy, {:id => @wiki_page.id}, {:user_id => @mod.id}
end
@wiki_page.reload
assert_equal(@mod.id, @wiki_page.updater_id)
end
end
context "revert action" do