diff options
Diffstat (limited to 'spec/serializers/pipeline_entity_spec.rb')
-rw-r--r-- | spec/serializers/pipeline_entity_spec.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index 914f42054bd..e638b14765b 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PipelineEntity do +RSpec.describe PipelineEntity do include Gitlab::Routing let_it_be(:project) { create(:project) } @@ -261,5 +261,29 @@ describe PipelineEntity do end end end + + context 'when pipeline has build report results' do + let(:pipeline) { create(:ci_pipeline, :with_report_results, project: project, user: user) } + + context 'when feature is enabled' do + before do + stub_feature_flags(build_report_summary: true) + end + + it 'exposes tests total count' do + expect(subject[:tests_total_count]).to eq(2) + end + end + + context 'when feature is disabled' do + before do + stub_feature_flags(build_report_summary: false) + end + + it 'do not expose tests total count' do + expect(subject).not_to include(:tests_total_count) + end + end + end end end |