summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorAleksei Lipniagov <alipniagov@gitlab.com>2019-08-09 17:46:55 +0300
committerAleksei Lipniagov <alipniagov@gitlab.com>2019-08-09 17:52:38 +0300
commit3c25e8734f137d5e32d0cce4ec4cd95e90a39d07 (patch)
tree3ff5d06849d9a5a1ff1d3107dc61a86b7ba638ac /spec/services
parent71d8815405b09046b2e4bcf0ea0a732d21c87e2a (diff)
downloadgitlab-ce-3c25e8734f137d5e32d0cce4ec4cd95e90a39d07.tar.gz
Fix :wiki_can_not_be_created_total counteralipniagov-fix-wiki_can_not_be_created_total-counter
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/projects/update_service_spec.rb5
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