diff options
Diffstat (limited to 'spec/tooling/danger/feature_flag_spec.rb')
-rw-r--r-- | spec/tooling/danger/feature_flag_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/tooling/danger/feature_flag_spec.rb b/spec/tooling/danger/feature_flag_spec.rb index 4575d8ca981..f4df2e1226c 100644 --- a/spec/tooling/danger/feature_flag_spec.rb +++ b/spec/tooling/danger/feature_flag_spec.rb @@ -83,6 +83,28 @@ RSpec.describe Tooling::Danger::FeatureFlag do end end + describe '#stage_label' do + before do + allow(fake_helper).to receive(:mr_labels).and_return(labels) + end + + context 'when there is no stage label' do + let(:labels) { [] } + + it 'returns nil' do + expect(feature_flag.stage_label).to be_nil + end + end + + context 'when there is a stage label' do + let(:labels) { ['devops::verify', 'group::pipeline execution'] } + + it 'returns the stage label' do + expect(feature_flag.stage_label).to eq(labels.first) + end + end + end + describe described_class::Found do let(:feature_flag_path) { 'config/feature_flags/development/entry.yml' } let(:group) { 'group::source code' } |