diff options
Diffstat (limited to 'spec/support/shared_examples/graphql/types')
-rw-r--r-- | spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb b/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb index 2d7da9f9f00..67576a18c80 100644 --- a/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb +++ b/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb @@ -86,4 +86,25 @@ RSpec.shared_examples 'Gitlab-style deprecations' do eq("`alpha` and `deprecated` arguments cannot be passed at the same time") ) end + + describe 'visible?' do + let(:ctx) { {} } + + it 'defaults to true' do + expect(subject).to be_visible(ctx) + end + + context 'when subject is deprecated' do + let(:arguments) { { deprecated: { milestone: '1.10', reason: :renamed } } } + + it 'defaults to true' do + expect(subject(arguments)).to be_visible(ctx) + end + + it 'returns false if `remove_deprecated` is true in context' do + ctx = { remove_deprecated: true } + expect(subject(arguments)).not_to be_visible(ctx) + end + end + end end |