khamusa / rspec-graphql_matchers

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

Test resolution with property #3

Closed khamusa closed 7 years ago

khamusa commented 7 years ago

Add an easy way to test the usage of property: field :public, types.Boolean, property: :is_public

marcgreenstock commented 7 years ago

I'll take a stab at this.

how will something like this work?

it { is_expected.to have_a_field(:public).with_property(:is_public) }

I think it should also be capable of matching other options too, like hash_key and metadata.

it { is_expected.to have_a_field(:myThing).with_hash_key(:my_thing).with_metadata(foo: :bar, baz: true) }
khamusa commented 7 years ago

Nice! This looks good!