diff options
| author | mo khan <mo@mokhan.ca> | 2015-01-27 21:52:17 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-01-27 21:52:17 -0700 |
| commit | 63a52f3552b940a8222a0ad2cbc647bd92175daf (patch) | |
| tree | b687db75947c0a8d4e9fa0c8cc9d6a0e5246eb7c /spec/controllers/api | |
| parent | fb0d7c8cb573e7ed9ee9004d0b7819740d64c1ca (diff) | |
add spec for creating a new cake.
Diffstat (limited to 'spec/controllers/api')
| -rw-r--r-- | spec/controllers/api/v1/cakes_controller_spec.rb | 11 |
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 |
