summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authormo k <mo.khan@gmail.com>2014-11-22 21:35:38 -0700
committermo k <mo.khan@gmail.com>2014-11-22 21:35:38 -0700
commit7620674929c024a7279dfa116deab8805f2fb2ec (patch)
tree38e5daa58e646a1907765def9c64d2f7a56b5fe9 /spec/controllers
parent31b5a3cf55d273dfc93385be8cf28ce1f8f8abd2 (diff)
parent66c09b81c3a4baeb0ca39a1e87496cca53a43a7c (diff)
Merged in mocheen/cakeside/cake-uploads (pull request #117)
add tools to cake edit page.
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/api/v1/tutorials_controller_spec.rb5
-rw-r--r--spec/controllers/registrations_controller_spec.rb2
-rw-r--r--spec/controllers/sessions_controller_spec.rb4
3 files changed, 5 insertions, 6 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])
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index 692500fd..9a9eaf63 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -10,7 +10,7 @@ describe RegistrationsController do
post :create, user: { name: 'mo', email: 'mo@cakeside.com', password: 'password' }
expect(User.count).to eql(1)
- expect(response).to redirect_to(my_root_path)
+ expect(response).to redirect_to(my_dashboard_path)
expect(cookies.signed[:raphael]).to_not be_nil
expect(cookies.signed[:raphael]).to eql(user_session.access)
end
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb
index 7de183d9..63ca58ca 100644
--- a/spec/controllers/sessions_controller_spec.rb
+++ b/spec/controllers/sessions_controller_spec.rb
@@ -17,7 +17,7 @@ describe SessionsController do
it "redirects to the dashboard" do
get :new
- expect(response).to redirect_to(my_root_path)
+ expect(response).to redirect_to(my_dashboard_path)
end
end
end
@@ -39,7 +39,7 @@ describe SessionsController do
end
it "redirects to the dashboard" do
- expect(response).to redirect_to(my_root_path)
+ expect(response).to redirect_to(my_dashboard_path)
end
end