diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-11 18:33:24 +0200 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-11 18:33:24 +0200 |
commit | 8717c7dad9b5a8fa21ec9a652c54718a6b4c2175 (patch) | |
tree | abedd3ea3e4de67953b992df1a67d7baef8aebe2 /spec/finders | |
parent | c7c630f142a23505b4adce449c0a176dec142384 (diff) | |
download | gitlab-ce-8717c7dad9b5a8fa21ec9a652c54718a6b4c2175.tar.gz |
Revert "Merge branch 'ee-5481-epic-todos' into 'master'"
This reverts commit 4d9a3f42f1fd3be21555e19872b7121cca65015e, reversing
changes made to ecf9c145f6e4d170cd059df88743393d9e63c489.
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/todos_finder_spec.rb | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb index 6061021d3b0..9747b9402a7 100644 --- a/spec/finders/todos_finder_spec.rb +++ b/spec/finders/todos_finder_spec.rb @@ -5,76 +5,12 @@ describe TodosFinder do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } - let(:issue) { create(:issue, project: project) } - let(:merge_request) { create(:merge_request, source_project: project) } let(:finder) { described_class } before do group.add_developer(user) end - describe '#execute' do - context 'visibility' do - let(:private_group_access) { create(:group, :private) } - let(:private_group_hidden) { create(:group, :private) } - let(:public_project) { create(:project, :public) } - let(:private_project_hidden) { create(:project) } - let(:public_group) { create(:group) } - - let!(:todo1) { create(:todo, user: user, project: project, group: nil) } - let!(:todo2) { create(:todo, user: user, project: public_project, group: nil) } - let!(:todo3) { create(:todo, user: user, project: private_project_hidden, group: nil) } - let!(:todo4) { create(:todo, user: user, project: nil, group: group) } - let!(:todo5) { create(:todo, user: user, project: nil, group: private_group_access) } - let!(:todo6) { create(:todo, user: user, project: nil, group: private_group_hidden) } - let!(:todo7) { create(:todo, user: user, project: nil, group: public_group) } - - before do - private_group_access.add_developer(user) - end - - it 'returns only todos with a target a user has access to' do - todos = finder.new(user).execute - - expect(todos).to match_array([todo1, todo2, todo4, todo5, todo7]) - end - end - - context 'filtering' do - let!(:todo1) { create(:todo, user: user, project: project, target: issue) } - let!(:todo2) { create(:todo, user: user, group: group, target: merge_request) } - - it 'returns correct todos when filtered by a project' do - todos = finder.new(user, { project_id: project.id }).execute - - expect(todos).to match_array([todo1]) - end - - it 'returns correct todos when filtered by a group' do - todos = finder.new(user, { group_id: group.id }).execute - - 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 - - expect(todos).to match_array([todo1]) - end - - context 'with subgroups', :nested_groups do - let(:subgroup) { create(:group, parent: group) } - let!(:todo3) { create(:todo, user: user, group: subgroup, target: issue) } - - it 'returns todos from subgroups when filtered by a group' do - todos = finder.new(user, { group_id: group.id }).execute - - expect(todos).to match_array([todo1, todo2, todo3]) - end - end - end - end - describe '#sort' do context 'by date' do let!(:todo1) { create(:todo, user: user, project: project) } |