Commit debe4690 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'ld-move-base_field_spec-description' into 'master'

Move tests of BaseField description to be sibling of "complexity" context

See merge request gitlab-org/gitlab!27297
parents 99b76451 0a83138a
...@@ -167,30 +167,30 @@ describe Types::BaseField do ...@@ -167,30 +167,30 @@ describe Types::BaseField do
end end
end end
end end
end
describe '#description' do describe '#description' do
context 'feature flag given' do context 'feature flag given' do
let(:field) { described_class.new(name: 'test', type: GraphQL::STRING_TYPE, feature_flag: flag, null: false, description: 'Test description') } let(:field) { described_class.new(name: 'test', type: GraphQL::STRING_TYPE, feature_flag: flag, null: false, description: 'Test description') }
let(:flag) { :test_flag } let(:flag) { :test_flag }
it 'prepends the description' do it 'prepends the description' do
expect(field.description). to eq 'Test description. Available only when feature flag `test_flag` is enabled.' expect(field.description). to eq 'Test description. Available only when feature flag `test_flag` is enabled.'
end end
context 'falsey feature_flag values' do context 'falsey feature_flag values' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:flag, :feature_value) do where(:flag, :feature_value) do
'' | false '' | false
'' | true '' | true
nil | false nil | false
nil | true nil | true
end end
with_them do with_them do
it 'returns the correct description' do it 'returns the correct description' do
expect(field.description).to eq('Test description') expect(field.description).to eq('Test description')
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment