Skip to content

Commit

Permalink
Added tests for facets argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Harris committed Feb 12, 2009
1 parent 50336a8 commit 9a2184e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/nytimes/articles/test_article.rb
Expand Up @@ -59,11 +59,16 @@ def setup
# should "accept a date_range argument with a begin and end date argument"
end

context "return_facets" do
should "accept a single string"
context "facets" do
should "accept a single string" do
Article.expects(:invoke).with(has_entry("facets", [Facet::DATE]))
Article.search "FOO BAR", :facets => Facet::DATE
end

should "accept an array of strings"
should "also accept Facet instances and use their type in the search"
should "accept an array of strings" do
Article.expects(:invoke).with(has_entry("facets", [Facet::DATE, Facet::GEOGRAPHIC]))
Article.search "FOO BAR", :facets => [Facet::DATE, Facet::GEOGRAPHIC]
end
end

context "offset" do
Expand Down

0 comments on commit 9a2184e

Please sign in to comment.