BURs: add nuke command.

Usage:

* `nuke touhou`
* `nuke pool:Disgustingly_Adorable`

Add a command for nuking tags. `nuke A` is a shortcut for `mass update A -> -A`.
This means it also works for pools.
This commit is contained in:
evazion
2020-12-02 13:08:34 -06:00
parent 86e4c21e48
commit b7b15b3d95
2 changed files with 34 additions and 1 deletions

View File

@@ -252,6 +252,24 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
end
end
context "the nuke command" do
should "remove tags" do
@p1 = create(:post, tag_string: "foo")
@p2 = create(:post, tag_string: "bar")
@bur = create_bur!("nuke foo", @admin)
assert_equal("tagme", @p1.reload.tag_string)
end
should "remove pools" do
@pool = create(:pool)
@post = create(:post, tag_string: "bar pool:#{@pool.id}")
@bur = create_bur!("nuke pool:#{@pool.id}", @admin)
assert_equal([], @pool.post_ids)
end
end
context "that contains a mass update followed by an alias" do
should "make the alias take effect after the mass update" do
@p1 = create(:post, tag_string: "maid_dress")