diff options
Diffstat (limited to 'spec/services/projects/all_merge_requests_count_service_spec.rb')
-rw-r--r-- | spec/services/projects/all_merge_requests_count_service_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/services/projects/all_merge_requests_count_service_spec.rb b/spec/services/projects/all_merge_requests_count_service_spec.rb new file mode 100644 index 00000000000..13954d688aa --- /dev/null +++ b/spec/services/projects/all_merge_requests_count_service_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Projects::AllMergeRequestsCountService, :use_clean_rails_memory_store_caching do + let_it_be(:project) { create(:project) } + + subject { described_class.new(project) } + + it_behaves_like 'a counter caching service' + + describe '#count' do + it 'returns the number of all merge requests' do + create(:merge_request, + :opened, + source_project: project, + target_project: project) + create(:merge_request, + :closed, + source_project: project, + target_project: project) + create(:merge_request, + :merged, + source_project: project, + target_project: project) + + expect(subject.count).to eq(3) + end + end +end |