diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-04 11:41:56 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-04 18:43:13 +0300 |
commit | 2f50b206f2921faf47637af526d810bc10ffb3ef (patch) | |
tree | 33d200cc365463a5949ca5ee84bf92c8eaa56693 /spec | |
parent | 35ba75f6b93c77f078ab2cf538a256f8aa534eb3 (diff) |
Hide archived projects from `shared_projects`
Since we don't show the archived projects, we shouldnot load them and
pass them to the fronted to be filtered out again.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/groups/shared_projects_controller_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/controllers/groups/shared_projects_controller_spec.rb b/spec/controllers/groups/shared_projects_controller_spec.rb index d8fa41abb18..003c8c262e7 100644 --- a/spec/controllers/groups/shared_projects_controller_spec.rb +++ b/spec/controllers/groups/shared_projects_controller_spec.rb @@ -38,7 +38,7 @@ describe Groups::SharedProjectsController do end it 'allows filtering shared projects' do - project = create(:project, :archived, namespace: user.namespace, name: "Searching for") + project = create(:project, namespace: user.namespace, name: "Searching for") share_project(project) get_shared_projects(filter: 'search') @@ -55,5 +55,14 @@ describe Groups::SharedProjectsController do expect(json_project_ids).to eq([second_project.id, shared_project.id]) end + + it 'does not include archived projects' do + archived_project = create(:project, :archived, namespace: user.namespace) + share_project(archived_project) + + get_shared_projects + + expect(json_project_ids).to contain_exactly(shared_project.id) + end end end |