diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 18:09:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 18:09:36 +0300 |
commit | 074d013e1eb3f6e0c27f96a3be8b9361254c8a98 (patch) | |
tree | f185c474ddc8624a4793c84b0b1f4cc07349694b /spec/graphql/resolvers | |
parent | 8f9beefac3774b30e911fb00a68f4c7a5244cf27 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql/resolvers')
-rw-r--r-- | spec/graphql/resolvers/error_tracking/sentry_detailed_error_resolver_spec.rb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/spec/graphql/resolvers/error_tracking/sentry_detailed_error_resolver_spec.rb b/spec/graphql/resolvers/error_tracking/sentry_detailed_error_resolver_spec.rb index 4490b54d1f7..8b2e33cdfda 100644 --- a/spec/graphql/resolvers/error_tracking/sentry_detailed_error_resolver_spec.rb +++ b/spec/graphql/resolvers/error_tracking/sentry_detailed_error_resolver_spec.rb @@ -18,6 +18,16 @@ describe Resolvers::ErrorTracking::SentryDetailedErrorResolver do .and_return issue_details_service end + shared_examples 'it resolves to nil' do + it 'resolves to nil' do + allow(issue_details_service).to receive(:execute) + .and_return(issue: nil) + + result = resolve_error(args) + expect(result).to be_nil + end + end + describe '#resolve' do let(:args) { { id: issue_global_id(1234) } } @@ -32,7 +42,7 @@ describe Resolvers::ErrorTracking::SentryDetailedErrorResolver do before do allow(issue_details_service).to receive(:execute) - .and_return({ issue: detailed_error }) + .and_return(issue: detailed_error) end it 'resolves to a detailed error' do @@ -44,12 +54,14 @@ describe Resolvers::ErrorTracking::SentryDetailedErrorResolver do end end - it 'resolves to nil if no match' do - allow(issue_details_service).to receive(:execute) - .and_return({ issue: nil }) + context 'if id does not match issue' do + it_behaves_like 'it resolves to nil' + end - result = resolve_error(args) - expect(result).to eq nil + context 'blank id' do + let(:args) { { id: '' } } + + it_behaves_like 'it resolves to nil' end end |