Commit 7af7ba45 authored by Alex Kalderimis's avatar Alex Kalderimis

Spec support: Add shared example for invalid arguments to mutation

parent 0d7047e7
......@@ -19,6 +19,14 @@ RSpec.shared_examples 'a mutation that returns top-level errors' do |errors: []|
end
end
RSpec.shared_examples 'an invalid argument to the mutation' do |argument_name:|
it_behaves_like 'a mutation that returns top-level errors' do
let(:match_errors) do
contain_exactly(include("invalid value for #{GraphqlHelpers.fieldnamerize(argument_name)}"))
end
end
end
# Shared example for expecting schema-level errors.
# See https://graphql-ruby.org/mutations/mutation_errors#errors-as-data
#
......
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