Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-17 11:06:00 +0300
committerPhil Hughes <me@iamphill.com>2016-06-17 11:06:00 +0300
commitb56965c5bb6a92b7bf4a7158c5f9555b7c1a9e2b (patch)
tree61fbbb9b31b2f6df653350a69689d32d684c1cde /spec/controllers
parent85fab13ebaf10982c0957daca0afd1ea145e64df (diff)
Correctly checks if user is logged in when adding todo
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/todo_controller_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/controllers/projects/todo_controller_spec.rb b/spec/controllers/projects/todo_controller_spec.rb
index ce9c57873fc..ea554d99fc1 100644
--- a/spec/controllers/projects/todo_controller_spec.rb
+++ b/spec/controllers/projects/todo_controller_spec.rb
@@ -39,4 +39,17 @@ describe Projects::TodosController do
expect(response.status).to eq(404)
end
end
+
+ describe 'POST #create when not logged in' do
+ it 'should create todo for issue' do
+ expect do
+ post(:create, namespace_id: project.namespace.path,
+ project_id: project.path,
+ issuable_id: issue.id,
+ issuable_type: "issue")
+ end.to change { user.todos.count }.by(0)
+
+ expect(response.status).to eq(302)
+ end
+ end
end