summaryrefslogtreecommitdiff
path: root/spec/controllers/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-11-22 21:26:43 -0700
committermo khan <mo@mokhan.ca>2014-11-22 21:26:43 -0700
commit66c09b81c3a4baeb0ca39a1e87496cca53a43a7c (patch)
tree6d8785cf262d7619652d40f848d4959ca15a1a00 /spec/controllers/api
parent082832b62f281779bb26ae9ca5a1743e00259c09 (diff)
render proper json when creating a new tutorial.
Diffstat (limited to 'spec/controllers/api')
-rw-r--r--spec/controllers/api/v1/tutorials_controller_spec.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/controllers/api/v1/tutorials_controller_spec.rb b/spec/controllers/api/v1/tutorials_controller_spec.rb
index 435e6136..7d7ef5c6 100644
--- a/spec/controllers/api/v1/tutorials_controller_spec.rb
+++ b/spec/controllers/api/v1/tutorials_controller_spec.rb
@@ -11,9 +11,8 @@ describe Api::V1::TutorialsController do
let(:my_tutorial) { create(:tutorial, user: user) }
let(:other_tutorial) { create(:tutorial) }
-
it "returns the users tutorials" do
- get :index, format: :json
+ xhr :get, :index
expect(assigns(:tutorials)).to include(my_tutorial)
expect(assigns(:tutorials)).to_not include(other_tutorial)
end
@@ -28,7 +27,7 @@ describe Api::V1::TutorialsController do
description: "Connect with your friends - and other fascinating people. Get in-the-moment updates on the things that interest you. And watch events unfold, in real time, from every angle.",
tags: "cake,cookie",
}
- post :create, tutorial: attributes, format: :json
+ xhr :post, :create, tutorial: attributes
expect(assigns(:tutorial)).to be_present
expect(assigns(:tutorial).url).to eql(attributes[:url])