Failing test: where_exp filter should filter posts

This commit is contained in:
Pat Hawks 2016-07-14 13:08:25 -05:00
parent 8a3ea59141
commit 2b57795c7f
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
1 changed files with 8 additions and 0 deletions

View File

@ -594,6 +594,14 @@ class TestFilters < JekyllUnitTest
assert_equal "b", results[1]["id"] assert_equal "b", results[1]["id"]
assert_equal "d", results[2]["id"] assert_equal "d", results[2]["id"]
end end
should "filter posts" do
site = fixture_site.tap(&:read)
posts = site.site_payload["site"]["posts"]
results = @filter.where_exp(posts, "obj", "obj.title == 'Foo Bar'")
assert_equal 1, results.length
assert_equal site.posts.find { |p| p.title == "Foo Bar" }, results.first
end
end end
context "sort filter" do context "sort filter" do