Skip to content

Commit

Permalink
Added Delete Base Images Support
Browse files Browse the repository at this point in the history
  • Loading branch information
mtaylor committed Jul 5, 2012
1 parent 534891a commit b03439d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,15 @@ Response
<base_image href='http://localhost:3000/base_images/2' id='2'></base_image>
<base_image href='http://localhost:3000/base_images/3' id='3'></base_image>
</base_images>

==== Delete Base Image

Request

curl -X DELETE--header "Accept: application/xml" http://localhost:3000/base_images/1

Response

Code: 204

Body:
17 changes: 17 additions & 0 deletions spec/controllers/base_images_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,23 @@ module ImageManagement
end
end
end

describe "List Delete Image" do
context "Success" do
it "should return a no content code when deleting an image" do
base_image = Factory(:base_image)
delete :destroy, :id => base_image.id
response.code.should == "204"
end
end

context "Failure" do
it "should return a not found code when deleting an image that does not exist" do
delete :destroy, :id => -1
response.code.should == "404"
end
end
end
end
end
end

0 comments on commit b03439d

Please sign in to comment.