diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-12-07 20:41:30 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-01-02 22:45:25 +0300 |
commit | bf8c20729baffbf55605484230ff33680d72139b (patch) | |
tree | 70d9bea9ea2a37dc8cd8c37cda396fcf246db72b /spec/services/merge_requests/close_service_spec.rb | |
parent | 2cbb2d0eceaed0f31c92d4eed8932e98f4f74559 (diff) |
Cache merged and closed events data in merge_request_metrics table
Diffstat (limited to 'spec/services/merge_requests/close_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/close_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb index 2a59bc4594a..4d12de3ecce 100644 --- a/spec/services/merge_requests/close_service_spec.rb +++ b/spec/services/merge_requests/close_service_spec.rb @@ -52,6 +52,19 @@ describe MergeRequests::CloseService do end end + it 'updates metrics' do + metrics = merge_request.metrics + metrics_service = double(MergeRequestMetricsService) + allow(MergeRequestMetricsService) + .to receive(:new) + .with(metrics) + .and_return(metrics_service) + + expect(metrics_service).to receive(:close) + + described_class.new(project, user, {}).execute(merge_request) + end + it 'refreshes the number of open merge requests for a valid MR', :use_clean_rails_memory_store_caching do service = described_class.new(project, user, {}) |