summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-21 18:06:29 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-21 18:06:29 +0000
commitf1bb2a307e9b125a8ee0be3728cb0d1baa21a3d4 (patch)
tree154817af5e3f1b134be08ef22d1926edf87ab74f /spec/finders
parentad1e4b8fb8104b642fa79ed34fd144bc2bed8a19 (diff)
downloadgitlab-ce-f1bb2a307e9b125a8ee0be3728cb0d1baa21a3d4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/todos_finder_spec.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb
index 044e135fa0b..a4b076bc367 100644
--- a/spec/finders/todos_finder_spec.rb
+++ b/spec/finders/todos_finder_spec.rb
@@ -36,10 +36,18 @@ describe TodosFinder do
expect(todos).to match_array([todo1, todo2])
end
- it 'returns correct todos when filtered by a type' do
- todos = finder.new(user, { type: 'Issue' }).execute
+ context 'when filtering by type' do
+ it 'returns correct todos when filtered by a type' do
+ todos = finder.new(user, { type: 'Issue' }).execute
- expect(todos).to match_array([todo1])
+ expect(todos).to match_array([todo1])
+ end
+
+ it 'returns the correct todos when filtering for multiple types' do
+ todos = finder.new(user, { type: %w[Issue MergeRequest] }).execute
+
+ expect(todos).to match_array([todo1, todo2])
+ end
end
context 'when filtering for actions' do
@@ -53,12 +61,10 @@ describe TodosFinder do
expect(todos).to match_array([todo2])
end
- context 'multiple actions' do
- it 'returns the expected todos' do
- todos = finder.new(user, { action_id: [Todo::DIRECTLY_ADDRESSED, Todo::ASSIGNED] }).execute
+ it 'returns the expected todos when filtering for multiple action ids' do
+ todos = finder.new(user, { action_id: [Todo::DIRECTLY_ADDRESSED, Todo::ASSIGNED] }).execute
- expect(todos).to match_array([todo2, todo1])
- end
+ expect(todos).to match_array([todo2, todo1])
end
end
@@ -69,12 +75,10 @@ describe TodosFinder do
expect(todos).to match_array([todo2])
end
- context 'multiple actions' do
- it 'returns the expected todos' do
- todos = finder.new(user, { action: [:directly_addressed, :assigned] }).execute
+ it 'returns the expected todos when filtering for multiple action names' do
+ todos = finder.new(user, { action: [:directly_addressed, :assigned] }).execute
- expect(todos).to match_array([todo2, todo1])
- end
+ expect(todos).to match_array([todo2, todo1])
end
end
end