diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-06 06:09:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-06 06:09:23 +0300 |
commit | f098e6d3d2c8eaaec0a228c8a3ae01f770e15dd2 (patch) | |
tree | 611a38154ba90341f6c6935a51cf7962f5896790 /spec/graphql | |
parent | 697d1c4e06d1c232ca8b21805cc889a0991702ab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r-- | spec/graphql/types/base_field_spec.rb | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/spec/graphql/types/base_field_spec.rb b/spec/graphql/types/base_field_spec.rb index a3015a34afe..daed5725e26 100644 --- a/spec/graphql/types/base_field_spec.rb +++ b/spec/graphql/types/base_field_spec.rb @@ -203,7 +203,7 @@ describe Types::BaseField do end it 'raises an error if a required property is missing', :aggregate_failures do - expect { test_field(deprecated: { milestone: 1.0 }) }.to raise_error( + expect { test_field(deprecated: { milestone: '1.10' }) }.to raise_error( ArgumentError, 'Please provide a `reason` within `deprecated`' ) @@ -212,37 +212,44 @@ describe Types::BaseField do 'Please provide a `milestone` within `deprecated`' ) end + + it 'raises an error if milestone is not a String', :aggregate_failures do + expect { test_field(deprecated: { milestone: 1.10, reason: 'Deprecation reason' }) }.to raise_error( + ArgumentError, + '`milestone` must be a `String`' + ) + end end it 'adds a formatted `deprecated_reason` to the field' do - field = test_field(deprecated: { milestone: 1.0, reason: 'Deprecation reason' }) + field = test_field(deprecated: { milestone: '1.10', reason: 'Deprecation reason' }) - expect(field.deprecation_reason).to eq('Deprecation reason. Deprecated in 1.0') + expect(field.deprecation_reason).to eq('Deprecation reason. Deprecated in 1.10') end it 'appends to the description if given' do field = test_field( - deprecated: { milestone: 1.0, reason: 'Deprecation reason' }, + deprecated: { milestone: '1.10', reason: 'Deprecation reason' }, description: 'Field description' ) - expect(field.description).to eq('Field description. Deprecated in 1.0: Deprecation reason') + expect(field.description).to eq('Field description. Deprecated in 1.10: Deprecation reason') end it 'does not append to the description if it is absent' do - field = test_field(deprecated: { milestone: 1.0, reason: 'Deprecation reason' }) + field = test_field(deprecated: { milestone: '1.10', reason: 'Deprecation reason' }) expect(field.description).to be_nil end it 'interacts well with the `feature_flag` property' do field = test_field( - deprecated: { milestone: 1.0, reason: 'Deprecation reason' }, + deprecated: { milestone: '1.10', reason: 'Deprecation reason' }, description: 'Field description', feature_flag: 'foo_flag' ) - expect(field.description).to eq('Field description. Available only when feature flag `foo_flag` is enabled. Deprecated in 1.0: Deprecation reason') + expect(field.description).to eq('Field description. Available only when feature flag `foo_flag` is enabled. Deprecated in 1.10: Deprecation reason') end end end |