Add more cases for normalizing pixiv source searches

This commit is contained in:
Toks
2014-10-25 15:49:59 -04:00
parent ebd3ece4e8
commit 3194df7e85
2 changed files with 4 additions and 2 deletions

View File

@@ -1218,6 +1218,8 @@ class PostTest < ActiveSupport::TestCase
post = FactoryGirl.create(:post, :source => url)
assert_equal(1, Post.tag_match("source:*.pixiv.net/img*/artist-name/*").count)
assert_equal(0, Post.tag_match("source:*.pixiv.net/img*/artist-fake/*").count)
assert_equal(1, Post.tag_match("source:http://*.pixiv.net/img*/img/artist-name/*").count)
assert_equal(0, Post.tag_match("source:http://*.pixiv.net/img*/img/artist-fake/*").count)
assert_equal(1, Post.tag_match("source:pixiv/artist-name/*").count)
assert_equal(0, Post.tag_match("source:pixiv/artist-fake/*").count)
end