spec/harpy/resource_spec.rb in harpy-0.1.7 vs spec/harpy/resource_spec.rb in harpy-0.1.8
- old
+ new
@@ -324,13 +324,15 @@
]
}
eos
Harpy.client.should_receive(:get).with(url, :params => {"firstname" => "Anthony"}).and_return response
companies = Harpy::Spec::Company.search "firstname" => "Anthony"
- companies.should have(1).item
+ companies.should be_kind_of Harpy::Collection
+ companies.size.should == 1
companies.first.should be_kind_of Harpy::Spec::Company
companies.first.firstname.should == "Anthony"
companies.first.id.should == "1"
+ companies.url.should == url
end
it "delegates other response codes to client" do
response = Typhoeus::Response.new :code => 500
Harpy.client.should_receive(:get).with(url, :params => {}).and_return response
Harpy.client.should_receive(:invalid_code).with response
\ No newline at end of file