fixes #1354
This commit is contained in:
@@ -839,12 +839,28 @@ class PostTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
context "Searching:" do
|
||||
should "return posts for the age:<1m tag" do
|
||||
should "return posts for the age:>1m tag" do
|
||||
post1 = FactoryGirl.create(:post, :tag_string => "aaa")
|
||||
count = Post.tag_match("age:<1m").count
|
||||
count = Post.tag_match("age:>1m").count
|
||||
assert_equal(1, count)
|
||||
end
|
||||
|
||||
should "return posts for the age:>1m tag when the user is in Pacific time zone" do
|
||||
post1 = FactoryGirl.create(:post, :tag_string => "aaa")
|
||||
Time.zone = "Pacific Time (US & Canada)"
|
||||
count = Post.tag_match("age:>1m").count
|
||||
assert_equal(1, count)
|
||||
Time.zone = "Eastern Time (US & Canada)"
|
||||
end
|
||||
|
||||
should "return posts for the age:>1m tag when the user is in Tokyo time zone" do
|
||||
post1 = FactoryGirl.create(:post, :tag_string => "aaa")
|
||||
Time.zone = "Asia/Tokyo"
|
||||
count = Post.tag_match("age:>1m").count
|
||||
assert_equal(1, count)
|
||||
Time.zone = "Eastern Time (US & Canada)"
|
||||
end
|
||||
|
||||
should "return posts for the ' tag" do
|
||||
post1 = FactoryGirl.create(:post, :tag_string => "'")
|
||||
post2 = FactoryGirl.create(:post, :tag_string => "aaa bbb")
|
||||
|
||||
Reference in New Issue
Block a user