spec/resource_spec.rb in infoblox-0.2.6 vs spec/resource_spec.rb in infoblox-0.2.7

- old
+ new

@@ -33,9 +33,16 @@ uri = Infoblox::BASE_PATH + "foo:animal" allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction"}).and_return(FooResponse.new("[]")) FooResource.all(conn).should eq([]) end + it "should allow .all with return fields or max results" do + conn = double + uri = Infoblox::BASE_PATH + "foo:animal" + allow(conn).to receive(:get).with(uri, {:_return_fields => "name,junction", :_max_results => -70}).and_return(FooResponse.new("[]")) + FooResource.all(conn, :_max_results => -70).should eq([]) + end + it "should put with the right attributes" do conn = double uri = Infoblox::BASE_PATH + "abcd" allow(conn).to receive(:put).with(uri, {:name => "jerry", :junction => "32", :do_it => false}).and_return(FooResponse.new("\"foobar\"")) f = FooResource.new(:connection => conn)