Commit 0d7047e7 authored by Alex Kalderimis's avatar Alex Kalderimis

Spec-Support: allow matchers to be used for mutation top-level errors

parent a80d98b4
......@@ -7,13 +7,15 @@
#
# There must be a method or let called `mutation` defined that executes
# the mutation.
RSpec.shared_examples 'a mutation that returns top-level errors' do |errors:|
RSpec.shared_examples 'a mutation that returns top-level errors' do |errors: []|
let(:match_errors) { eq(errors) }
it do
post_graphql_mutation(mutation, current_user: current_user)
error_messages = graphql_errors.map { |e| e['message'] }
expect(error_messages).to eq(errors)
expect(error_messages).to match_errors
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