From 9a2184e397db0395350a35ad03519f6deac1354a Mon Sep 17 00:00:00 2001 From: Jacob Harris Date: Thu, 12 Feb 2009 17:02:51 -0500 Subject: [PATCH] Added tests for facets argument --- test/nytimes/articles/test_article.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/nytimes/articles/test_article.rb b/test/nytimes/articles/test_article.rb index cc18938..5190ae0 100644 --- a/test/nytimes/articles/test_article.rb +++ b/test/nytimes/articles/test_article.rb @@ -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