diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb')
-rw-r--r-- | spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb b/spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb index 20c2bdcd4e1..5834faea97e 100644 --- a/spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb +++ b/spec/graphql/resolvers/error_tracking/sentry_error_collection_resolver_spec.rb @@ -8,18 +8,22 @@ RSpec.describe Resolvers::ErrorTracking::SentryErrorCollectionResolver do let_it_be(:project) { create(:project) } let_it_be(:current_user) { create(:user) } - let(:list_issues_service) { spy('ErrorTracking::ListIssuesService') } + let(:list_issues_service) { instance_double('ErrorTracking::ListIssuesService') } - specify do - expect(described_class).to have_nullable_graphql_type(Types::ErrorTracking::SentryErrorCollectionType) + before_all do + project.add_developer(current_user) end before do - project.add_developer(current_user) - allow(ErrorTracking::ListIssuesService) .to receive(:new) .and_return list_issues_service + + allow(list_issues_service).to receive(:external_url) + end + + specify do + expect(described_class).to have_nullable_graphql_type(Types::ErrorTracking::SentryErrorCollectionType) end describe '#resolve' do @@ -34,8 +38,7 @@ RSpec.describe Resolvers::ErrorTracking::SentryErrorCollectionResolver do .to receive(:external_url) .and_return(fake_url) - result = resolve_error_collection - expect(result.external_url).to eq fake_url + expect(resolve_error_collection.external_url).to eq fake_url end it 'provides the project' do |