spec/collection_spec.rb in zendesk_api-0.1.6 vs spec/collection_spec.rb in zendesk_api-0.1.7
- old
+ new
@@ -568,9 +568,20 @@
it "should pass the correct query_path to the new collection" do
subject.recent.instance_variable_get(:@collection_path).last.should == :recent
end
end
+ context "with a module (Search)" do
+ subject { ZendeskAPI::Collection.new(client, ZendeskAPI::Search, :query => "hello") }
+
+ before(:each) do
+ stub_json_request(:get, %r{search\?query=hello}, json(:results => []))
+ end
+
+ it "should not blow up" do
+ subject.to_a.should == []
+ end
+ end
context "with different path" do
subject do
ZendeskAPI::Collection.new(client, ZendeskAPI::TestResource, :collection_path => ["test_resources", "active"])
end