Autotag character_(cosplay) -> character, cosplay.

Make e.g. hatsune_miku_(cosplay) automatically add hatsune_miku and cosplay.

Perform autotagging after aliasing so that *_(cosplay) aliases (e.g.
hestia_(dungeon)_(cosplay) -> hestia_(danmachi)_(cosplay)) can take
effect first.
This commit is contained in:
evazion
2016-11-04 23:13:35 -05:00
parent 4e48e80e1f
commit f02a31a447
2 changed files with 19 additions and 1 deletions

View File

@@ -932,6 +932,20 @@ class PostTest < ActiveSupport::TestCase
end
end
context "with *_(cosplay) tags" do
setup do
@post.add_tag("hakurei_reimu_(cosplay)")
@post.add_tag("hatsune_miku_(cosplay)")
@post.save
end
should "add the character tags and the cosplay tag" do
assert(@post.has_tag?("hakurei_reimu"))
assert(@post.has_tag?("hatsune_miku"))
assert(@post.has_tag?("cosplay"))
end
end
context "that has been updated" do
should "create a new version if it's the first version" do
assert_difference("PostVersion.count", 1) do