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:
authorJames Ramsay <jramsay@gitlab.com>2018-08-02 22:39:46 +0300
committerJames Ramsay <jramsay@gitlab.com>2018-08-03 18:55:21 +0300
commit79d90cb6bd99b7af572c65af89597c2e55217aea (patch)
treed28302d2bd63504b46c4eeef2877b4a3d099f893 /spec/features
parentc60cb3935089eeb358b8e96e63d879d5b49a3dcf (diff)
Use Projects::UpdateService to archive projects
System hooks were not being triggered when projects were archived or unarchived. Reuse the Projects::UpdateService to automatically trigger system hooks and increase code reuse.
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/explore/groups_list_spec.rb4
-rw-r--r--spec/features/groups/issues_spec.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb
index ad02b454aee..8ed4051856e 100644
--- a/spec/features/explore/groups_list_spec.rb
+++ b/spec/features/explore/groups_list_spec.rb
@@ -53,14 +53,14 @@ describe 'Explore Groups page', :js do
expect(find('.js-groups-list-holder .content-list li:first-child .stats .number-projects')).to have_text("1")
# Archive project
- empty_project.archive!
+ ::Projects::UpdateService.new(empty_project, user, archived: true).execute
visit explore_groups_path
# Check project count
expect(find('.js-groups-list-holder .content-list li:first-child .stats .number-projects')).to have_text("0")
# Unarchive project
- empty_project.unarchive!
+ ::Projects::UpdateService.new(empty_project, user, archived: false).execute
visit explore_groups_path
# Check project count
diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb
index 97d8776b15a..176f4a668ff 100644
--- a/spec/features/groups/issues_spec.rb
+++ b/spec/features/groups/issues_spec.rb
@@ -52,6 +52,7 @@ describe 'Group issues page' do
context 'issues list', :nested_groups do
let(:subgroup) { create(:group, parent: group) }
let(:subgroup_project) { create(:project, :public, group: subgroup)}
+ let(:user_in_group) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
let!(:issue) { create(:issue, project: project, title: 'root group issue') }
let!(:subgroup_issue) { create(:issue, project: subgroup_project, title: 'subgroup issue') }
@@ -67,7 +68,7 @@ describe 'Group issues page' do
context 'when project is archived' do
before do
- project.archive!
+ ::Projects::UpdateService.new(project, user_in_group, archived: true).execute
end
it 'does not render issue' do