diff options
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/matchers/graphql_matchers.rb | 6 | ||||
-rw-r--r-- | spec/support/shared_examples/error_tracking_shared_examples.rb | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/matchers/graphql_matchers.rb b/spec/support/matchers/graphql_matchers.rb index e151a934591..31b0290bb15 100644 --- a/spec/support/matchers/graphql_matchers.rb +++ b/spec/support/matchers/graphql_matchers.rb @@ -108,6 +108,12 @@ RSpec::Matchers.define :have_graphql_resolver do |expected| end end +RSpec::Matchers.define :have_graphql_extension do |expected| + match do |field| + expect(field.metadata[:type_class].extensions).to include(expected) + end +end + RSpec::Matchers.define :expose_permissions_using do |expected| match do |type| permission_field = type.fields['userPermissions'] diff --git a/spec/support/shared_examples/error_tracking_shared_examples.rb b/spec/support/shared_examples/error_tracking_shared_examples.rb new file mode 100644 index 00000000000..86134fa7fd1 --- /dev/null +++ b/spec/support/shared_examples/error_tracking_shared_examples.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'setting sentry error data' do + it 'sets the sentry error data correctly' do + aggregate_failures 'testing the sentry error is correct' do + expect(error['id']).to eql sentry_error.to_global_id.to_s + expect(error['sentryId']).to eql sentry_error.id.to_s + expect(error['status']).to eql sentry_error.status.upcase + expect(error['firstSeen']).to eql sentry_error.first_seen + expect(error['lastSeen']).to eql sentry_error.last_seen + end + end +end |