Add test for prom metric gathering

This commit is contained in:
Z.J. van de Weg 2017-06-08 09:58:38 +02:00
parent 4fa71584a3
commit ff1bc1778d
1 changed files with 8 additions and 0 deletions

View File

@ -38,6 +38,14 @@ describe Ci::CreatePipelineService, :services do
expect(pipeline.builds.first).to be_kind_of(Ci::Build)
end
it 'increments the prometheus counter' do
expect(Gitlab::Metrics).to receive(:counter)
.with(:pipelines_created_count, "Pipelines created count")
.and_call_original
pipeline
end
context 'when merge requests already exist for this source branch' do
it 'updates head pipeline of each merge request' do
merge_request_1 = create(:merge_request, source_branch: 'master', target_branch: "branch_1", source_project: project)