Commit e77715bc authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'bw-graphql-remove-to_graphql-2' into 'master'

Remove calls to deprecated `to_graphql` (Part 2)

See merge request gitlab-org/gitlab!82928
parents c5d2cca7 0bd00234
...@@ -7,14 +7,14 @@ RSpec::Matchers.define :require_graphql_authorizations do |*expected| ...@@ -7,14 +7,14 @@ RSpec::Matchers.define :require_graphql_authorizations do |*expected|
if klass.respond_to?(:required_permissions) if klass.respond_to?(:required_permissions)
klass.required_permissions klass.required_permissions
else else
[klass.to_graphql.metadata[:authorize]] Array.wrap(klass.authorize)
end end
end end
match do |klass| match do |klass|
actual = permissions_for(klass) actual = permissions_for(klass)
expect(actual).to match_array(expected) expect(actual).to match_array(expected.compact)
end end
failure_message do |klass| failure_message do |klass|
...@@ -213,16 +213,16 @@ RSpec::Matchers.define :have_graphql_resolver do |expected| ...@@ -213,16 +213,16 @@ RSpec::Matchers.define :have_graphql_resolver do |expected|
match do |field| match do |field|
case expected case expected
when Method when Method
expect(field.to_graphql.metadata[:type_class].resolve_proc).to eq(expected) expect(field.type_class.resolve_proc).to eq(expected)
else else
expect(field.to_graphql.metadata[:type_class].resolver).to eq(expected) expect(field.type_class.resolver).to eq(expected)
end end
end end
end end
RSpec::Matchers.define :have_graphql_extension do |expected| RSpec::Matchers.define :have_graphql_extension do |expected|
match do |field| match do |field|
expect(field.to_graphql.metadata[:type_class].extensions).to include(expected) expect(field.type_class.extensions).to include(expected)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment