Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7af7ba45
Commit
7af7ba45
authored
Jul 03, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spec support: Add shared example for invalid arguments to mutation
parent
0d7047e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
spec/support/shared_examples/graphql/mutation_shared_examples.rb
...pport/shared_examples/graphql/mutation_shared_examples.rb
+8
-0
No files found.
spec/support/shared_examples/graphql/mutation_shared_examples.rb
View file @
7af7ba45
...
...
@@ -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
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment