This commit is contained in:
albert
2013-03-08 15:56:24 -05:00
parent c3ac9832f9
commit 1a03f49adc
6 changed files with 37 additions and 12 deletions

View File

@@ -909,6 +909,13 @@ class PostTest < ActiveSupport::TestCase
assert_equal(post2.id, relation.first.id)
end
should "return posts for a case sensitive source search" do
post1 = FactoryGirl.create(:post, :source => "ABCD")
post2 = FactoryGirl.create(:post, :source => "1234")
relation = Post.tag_match("source:ABCD")
assert_equal(1, relation.count)
end
should "return posts for a pixiv source search" do
post = FactoryGirl.create(:post, :source => "http://i1.pixiv.net/img123/img/artist-name/789.png")
assert_equal(1, Post.tag_match("source:pixiv/artist-name/*").count)