diff options
Diffstat (limited to 'spec/graphql/types/issue_type_spec.rb')
-rw-r--r-- | spec/graphql/types/issue_type_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb index c0a0fdf3b0b..1b8bf007a73 100644 --- a/spec/graphql/types/issue_type_spec.rb +++ b/spec/graphql/types/issue_type_spec.rb @@ -66,10 +66,16 @@ RSpec.describe GitlabSchema.types['Issue'] do end context 'when user does not have the permission' do - it 'returns no data' do + before do allow(Ability).to receive(:allowed?).with(user, :read_project, project).and_return(false) + end - expect(subject.dig(:data, :project)).to eq(nil) + it 'does not return an error' do + expect(subject['errors']).to be_nil + end + + it 'returns no data' do + expect(subject['data']['project']).to be_nil end end |