spec/support/shared_examples/ridley_resource.rb in ridley-0.10.2 vs spec/support/shared_examples/ridley_resource.rb in ridley-0.11.0.rc1
- old
+ new
@@ -9,44 +9,23 @@
describe "::all" do
it "sends a get request for the class' resource_path using the given client" do
response.stub(:body) { Hash.new }
client.connection.should_receive(:get).with(subject.resource_path).and_return(response)
-
+
subject.all(client)
end
end
describe "::find" do
- it "delegates to find!" do
- id = double('id')
- subject.should_receive(:find!).with(client, id)
-
- subject.find(client, id)
- end
-
- context "when the resource is not found" do
- it "returns nil" do
- pending
- end
- end
- end
-
- describe "::find!" do
it "sends a get request to the given client to the resource_path of the class for the given chef_id" do
chef_id = "ridley_test"
response.stub(:body) { Hash.new }
client.connection.should_receive(:get).with("#{subject.resource_path}/#{chef_id}").and_return(response)
subject.find(client, chef_id)
end
-
- context "when the resource is not found" do
- it "raises a Ridley::Errors::HTTPNotFound error" do
- pending
- end
- end
end
describe "::create" do
it "sends a post request to the given client using the includer's resource_path" do
attrs = {
@@ -135,10 +114,10 @@
end
end
end
describe "#update" do
- context "when the object is valid" do
+ context "when the object is valid" do
let(:updated) do
updated = double('updated')
updated.stub(:[]).and_return(Hash.new)
updated.stub(:_attributes_).and_return(Hash.new)
updated