khamusa / rspec-graphql_matchers

Collection of rspec matchers to test your graphQL api schema.
MIT License
145 stars 49 forks source link

add a description matcher on the field #9

Closed marcgreenstock closed 5 years ago

marcgreenstock commented 7 years ago

As mentioned on #8, it would be nice to have a with_description. The argument could be optional to test if a field has a description, or with an argument that the description matches. e.g.

it { is_expected.to have_a_field(:id).with_description }
# or with an argument
it { is_expected.to have_a_field(:id).with_description('Database ID of the Post')
marcgreenstock commented 7 years ago

did you mean to close #3 instead?

khamusa commented 7 years ago

Yes, sorry

marcgreenstock commented 7 years ago

np :) I'll work on this issue in a few days.

It would also be good to have a matcher for description on the object type too:

it { is_expected.to have_a_description([optional description]) }
khamusa commented 5 years ago

Hey @marcgreenstock, the latest master branch has a refactored version of the sub-matches of have_a_field. It should be fairly trivial to implement the description matcher of a field on this new version. The BeOfType class is reused in both contexts, just like you suggested we do with the description. Let me know if you're interested in doing this.

Sorry for the huge delay on this...

khamusa commented 5 years ago

Closed by mistake

khamusa commented 5 years ago

Closing for inactivity, let me know if you want to get back to this.