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
691b1b99
Commit
691b1b99
authored
May 15, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GQL] Matchers: explain why arguments are wrong
This adds a failure message to the arguments matcher
parent
41c73d84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
spec/support/matchers/graphql_matchers.rb
spec/support/matchers/graphql_matchers.rb
+9
-2
No files found.
spec/support/matchers/graphql_matchers.rb
View file @
691b1b99
...
@@ -85,9 +85,16 @@ end
...
@@ -85,9 +85,16 @@ end
RSpec
::
Matchers
.
define
:have_graphql_arguments
do
|*
expected
|
RSpec
::
Matchers
.
define
:have_graphql_arguments
do
|*
expected
|
include
GraphqlHelpers
include
GraphqlHelpers
def
expected_names
@names
||=
Array
.
wrap
(
expected
).
map
{
|
name
|
GraphqlHelpers
.
fieldnamerize
(
name
)
}
end
match
do
|
field
|
match
do
|
field
|
argument_names
=
expected
.
map
{
|
name
|
GraphqlHelpers
.
fieldnamerize
(
name
)
}
expect
(
field
.
arguments
.
keys
).
to
contain_exactly
(
*
expected_names
)
expect
(
field
.
arguments
.
keys
).
to
contain_exactly
(
*
argument_names
)
end
failure_message
do
|
field
|
"expected that
#{
field
.
name
}
would have the following fields:
#{
expected_names
.
inspect
}
, but it has
#{
field
.
arguments
.
keys
.
inspect
}
."
end
end
end
end
...
...
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