Fix #5013: BUR model doesn't validate tags.
Don't allow users to request aliases, implications, or renames for invalid tag names. As a side effect, it's no longer possible to request shortcut aliases like `/hr -> hakurei_reimu` (slash abbreviations still exist, but they can't be overridden with aliases). Tests involving these types of aliases are removed.
This commit is contained in:
@@ -146,14 +146,14 @@ class BulkUpdateRequestsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
context "for a builder" do
|
||||
should "fail when moving a non-artist tag" do
|
||||
create(:tag, name: "sfw", post_count: 0)
|
||||
@bulk_update_request = create(:bulk_update_request, script: "alias sfw -> rating:s")
|
||||
create(:tag, name: "foo", post_count: 0)
|
||||
@bulk_update_request = create(:bulk_update_request, script: "alias foo -> bar")
|
||||
|
||||
post_auth approve_bulk_update_request_path(@bulk_update_request), @builder
|
||||
|
||||
assert_response 403
|
||||
assert_equal("pending", @bulk_update_request.reload.status)
|
||||
assert_equal(false, TagAlias.exists?(antecedent_name: "sfw", consequent_name: "rating:s"))
|
||||
assert_equal(false, TagAlias.exists?(antecedent_name: "foo", consequent_name: "bar"))
|
||||
end
|
||||
|
||||
should "fail for a large artist move" do
|
||||
|
||||
Reference in New Issue
Block a user