spec/springboard/client/resource_spec.rb in springboard-retail-4.1.1 vs spec/springboard/client/resource_spec.rb in springboard-retail-4.2.0
- old
+ new
@@ -95,9 +95,19 @@
resource.sort('f1', 'f2,desc')
expect(resource.sort('f3,asc', 'f4').uri.query).to eq('sort[]=f3%2Casc&sort[]=f4')
end
end
+ describe "only" do
+ it "should set the _only parameter based on the given values" do
+ expect(resource.only('f1', 'f2').uri.query).to eq('_only[]=f1&_only[]=f2')
+ end
+
+ it "should replace the existing _only parameters" do
+ expect(resource.only('f1').only('f2', 'f3').uri.query).to eq('_only[]=f2&_only[]=f3')
+ end
+ end
+
%w{count each each_page}.each do |method|
describe method do
it "should call the client's #{method} method with the resource's URI" do
expect(client).to receive(method).with(resource.uri)
resource.__send__(method)