diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-08-12 14:35:11 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-08-12 14:35:11 +0300 |
commit | 832824f46eced9c5e781bd41082a4743600fb050 (patch) | |
tree | 80185b0c3c369e11c9fc7996e23354fd3f6efed2 /spec | |
parent | 7a48b4d6b0f3e92887407768d639d13489d0d495 (diff) | |
parent | 3c25e8734f137d5e32d0cce4ec4cd95e90a39d07 (diff) |
Merge branch 'alipniagov-fix-wiki_can_not_be_created_total-counter' into 'master'
Fix :wiki_can_not_be_created_total counter
See merge request gitlab-org/gitlab-ce!31673
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/projects/update_service_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index 6bbaa410d56..82010dd283c 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -186,7 +186,10 @@ describe Projects::UpdateService do expect_any_instance_of(ProjectWiki).to receive(:wiki).and_raise(ProjectWiki::CouldNotCreateWikiError) expect_any_instance_of(described_class).to receive(:log_error).with("Could not create wiki for #{project.full_name}") - expect(Gitlab::Metrics).to receive(:counter) + + counter = double(:counter) + expect(Gitlab::Metrics).to receive(:counter).with(:wiki_can_not_be_created_total, 'Counts the times we failed to create a wiki').and_return(counter) + expect(counter).to receive(:increment) update_project(project, user, project_feature_attributes: { wiki_access_level: ProjectFeature::ENABLED }) end |