Skip to content

Reorganize specs to support GraphQL mutations#73

Merged
AlessioRocco merged 4 commits intomasterfrom
add-mutation-spec-helpers
Feb 7, 2020
Merged

Reorganize specs to support GraphQL mutations#73
AlessioRocco merged 4 commits intomasterfrom
add-mutation-spec-helpers

Conversation

@AlessioRocco
Copy link
Copy Markdown
Contributor

@AlessioRocco AlessioRocco commented Jan 31, 2020

Adds the RSpec helper methods and reorganize the folders to better interact with the GraphQL mutations.

@AlessioRocco AlessioRocco force-pushed the add-mutation-spec-helpers branch 4 times, most recently from 256fea2 to 47ad934 Compare February 7, 2020 13:34
@AlessioRocco AlessioRocco changed the title Add mutations spec helpers Reorganize specs to support GraphQL mutations Feb 7, 2020
@AlessioRocco AlessioRocco force-pushed the add-mutation-spec-helpers branch from 47ad934 to 0b6700e Compare February 7, 2020 13:53
@AlessioRocco AlessioRocco self-assigned this Feb 7, 2020
@AlessioRocco AlessioRocco marked this pull request as ready for review February 7, 2020 13:56
@AlessioRocco AlessioRocco force-pushed the add-mutation-spec-helpers branch from 0b6700e to 679cef6 Compare February 7, 2020 14:13
Replace the constant and the hardcoded paths with RSpec custom settings.
We are going to add the GraphQL mutations and moves the queries and
responses under "spec/support/graphql/" will help us to have a better
folder structure.
Also, the integration specs are moved to "spec/integration/queries/"
for the same reason.
It allows executing a mutation from a gql file located in the folder
specified by the 'graphql_mutation_folder' RSpec setting by using just
its name and returns the result as a Hash by default.
It is of type "graphql_mutation" and can be used in the specs to explain
better the result of a Graphql mutation.
The "graphql_mutation" sets the subject by default through the
"graphql mutation subject" shared context.
The subject mutation can be set using a "let(:mutation)" or with the
"mutation" metadata, and also the 'context' and 'variables' can be used
in the same way.
@AlessioRocco AlessioRocco force-pushed the add-mutation-spec-helpers branch from 679cef6 to 74b16f2 Compare February 7, 2020 14:20
Copy link
Copy Markdown
Contributor

@ChristianRimondi ChristianRimondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AlessioRocco AlessioRocco merged commit e0eedbf into master Feb 7, 2020
@ChristianRimondi ChristianRimondi deleted the add-mutation-spec-helpers branch February 14, 2020 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants