Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c3e923c4
Commit
c3e923c4
authored
May 25, 2016
by
DJ Mountney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure we don't show TODOS for projects pending delete
By joining the Todos on the project table.
parent
ab75b21c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/finders/todos_finder.rb
app/finders/todos_finder.rb
+1
-1
spec/features/todos/todos_spec.rb
spec/features/todos/todos_spec.rb
+13
-0
No files found.
app/finders/todos_finder.rb
View file @
c3e923c4
...
@@ -23,7 +23,7 @@ class TodosFinder
...
@@ -23,7 +23,7 @@ class TodosFinder
end
end
def
execute
def
execute
items
=
current_user
.
todos
items
=
current_user
.
todos
.
joins
(
:project
).
where
(
projects:
{
pending_delete:
false
})
items
=
by_action_id
(
items
)
items
=
by_action_id
(
items
)
items
=
by_author
(
items
)
items
=
by_author
(
items
)
items
=
by_project
(
items
)
items
=
by_project
(
items
)
...
...
spec/features/todos/todos_spec.rb
View file @
c3e923c4
...
@@ -98,5 +98,18 @@ describe 'Dashboard Todos', feature: true do
...
@@ -98,5 +98,18 @@ describe 'Dashboard Todos', feature: true do
end
end
end
end
end
end
context
'User has a Todo in a project pending deletion'
do
before
do
deleted_project
=
create
(
:project
,
pending_delete:
true
)
create
(
:todo
,
:mentioned
,
user:
user
,
project:
deleted_project
,
target:
issue
,
author:
author
)
login_as
(
user
)
visit
dashboard_todos_path
end
it
'shows "All done" message'
do
expect
(
page
).
to
have_content
"You're all done!"
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment