Remove mod-only user revert system (#4178).

The mass undo system from #4178 replaces this system.

Followup to f2dccf8cf.
This commit is contained in:
evazion
2019-09-27 21:48:49 -05:00
parent 3b75dbf64f
commit a39b67b901
9 changed files with 1 additions and 118 deletions

View File

@@ -1,44 +0,0 @@
require 'test_helper'
class UserRevertTest < ActiveSupport::TestCase
context "Reverting a user's changes" do
setup do
@creator = create(:user)
@user = create(:user)
CurrentUser.scoped(@creator) do
@parent = create(:post)
@post = create(:post, :tag_string => "aaa bbb ccc", :rating => "q", :source => "xyz")
end
@post.stubs(:merge_version?).returns(false)
CurrentUser.scoped(@user) do
@post.update(:tag_string => "bbb ccc xxx", :source => "", :rating => "e")
end
end
subject { UserRevert.new(@user.id) }
should "have the correct data" do
assert_equal("bbb ccc xxx", @post.tag_string)
assert_equal("", @post.source)
assert_equal("e", @post.rating)
end
context "when processed" do
setup do
CurrentUser.as(@user) do
subject.process
end
@post.reload
end
should "revert the user's changes" do
assert_equal("aaa bbb ccc", @post.tag_string)
assert_equal("xyz", @post.source)
assert_equal("q", @post.rating)
end
end
end
end