summaryrefslogtreecommitdiff
path: root/spec/controllers/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-01-27 21:52:17 -0700
committermo khan <mo@mokhan.ca>2015-01-27 21:52:17 -0700
commit63a52f3552b940a8222a0ad2cbc647bd92175daf (patch)
treeb687db75947c0a8d4e9fa0c8cc9d6a0e5246eb7c /spec/controllers/api
parentfb0d7c8cb573e7ed9ee9004d0b7819740d64c1ca (diff)
add spec for creating a new cake.
Diffstat (limited to 'spec/controllers/api')
-rw-r--r--spec/controllers/api/v1/cakes_controller_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/controllers/api/v1/cakes_controller_spec.rb b/spec/controllers/api/v1/cakes_controller_spec.rb
index 3985676d..a03f7e73 100644
--- a/spec/controllers/api/v1/cakes_controller_spec.rb
+++ b/spec/controllers/api/v1/cakes_controller_spec.rb
@@ -41,8 +41,15 @@ describe Api::V1::CakesController do
end
end
- xdescribe "#create" do
-
+ describe "#create" do
+ let(:category) { create(:category) }
+
+ it 'creates a new project' do
+ xhr :post, :create, cake: { name: 'new-cake', category_id: category.id }
+ expect(Creation.count).to eql(1)
+ expect(Creation.first.name).to eql('new-cake')
+ expect(Creation.first.category).to eql(category)
+ end
end
xdescribe "#update" do