summaryrefslogtreecommitdiff
path: root/spec/unit/search
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-12-19 12:45:51 -0800
committerClaire McQuin <claire@getchef.com>2014-12-19 12:45:51 -0800
commit8261791ced25227781f0d0ad3f44ef77c889d53b (patch)
tree8d53acd234d25cb559d61937a27757f9bf78f18a /spec/unit/search
parentfe8ca9ea64205288d3cc0fa2ea6b80c953f8ea4c (diff)
downloadchef-8261791ced25227781f0d0ad3f44ef77c889d53b.tar.gz
Build configurable search string.mcquin/bugfix/search-filtering
Diffstat (limited to 'spec/unit/search')
-rw-r--r--spec/unit/search/query_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb
index e426ddd25d..2fb197b183 100644
--- a/spec/unit/search/query_spec.rb
+++ b/spec/unit/search/query_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Search::Query do
let(:query) { Chef::Search::Query.new }
shared_context "filtered search" do
- let(:query_string) { "search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=" }
+ let(:query_string) { "search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=0" }
let(:server_url) { "https://api.opscode.com/organizations/opscode/nodes" }
let(:args) { { filter_key => filter_hash } }
let(:filter_hash) {
@@ -147,22 +147,22 @@ describe Chef::Search::Query do
end
it "queries for every object of a type by default" do
- expect(rest).to receive(:get_rest).with("search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0").and_return(response)
query.search(:node)
end
it "allows a custom query" do
- expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=0").and_return(response)
query.search(:node, "platform:rhel")
end
it "lets you set a sort order" do
- expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=0&rows=").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=0").and_return(response)
query.search(:node, "platform:rhel", sort: "id desc")
end
it "lets you set a starting object" do
- expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=2&rows=").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=2").and_return(response)
query.search(:node, "platform:rhel", start: 2)
end