summaryrefslogtreecommitdiff
path: root/spec/controllers/api
diff options
context:
space:
mode:
authormo khan <mokhan@users.noreply.github.com>2015-01-28 21:40:26 -0700
committermo khan <mokhan@users.noreply.github.com>2015-01-28 21:40:26 -0700
commitc64e5008a494d1236e80df5583104bdc3b02bff4 (patch)
tree99c491cd658ef6ffba763f6a4cf468920b2950fd /spec/controllers/api
parentf443808664049f7e05cfeba3e99d226e8d44c749 (diff)
parentee997778cbc88c8c2b9ed39df174e7ea91447abf (diff)
Merge pull request #8 from mokhan/delete-cake
return json response from deleting a cake.
Diffstat (limited to 'spec/controllers/api')
-rw-r--r--spec/controllers/api/v1/cakes_controller_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/controllers/api/v1/cakes_controller_spec.rb b/spec/controllers/api/v1/cakes_controller_spec.rb
index e0cb3a64..7f84d3ae 100644
--- a/spec/controllers/api/v1/cakes_controller_spec.rb
+++ b/spec/controllers/api/v1/cakes_controller_spec.rb
@@ -66,7 +66,7 @@ describe Api::V1::CakesController do
end
it "updates the description" do
- new_story = "what's the haps on the craps"
+ new_story = "what is the haps on the craps"
xhr :patch, :update, id: cake.id, cake: { story: new_story }
cake.reload
@@ -93,6 +93,11 @@ describe Api::V1::CakesController do
it "deletes the specified cake" do
expect(Creation.exists?(cake.id)).to be_falsey
end
+
+ it "returns an empty json response" do
+ json = JSON.parse(response.body)
+ expect(json["id"]).to eql(cake.id)
+ end
end
end
end