Skip to content

Commit

Permalink
Version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
khamusa committed May 7, 2020
1 parent 75aae2f commit f8f89cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Changelog

### Breaking changes

### Deprecations
## 1.3.0 (May 7th, 2020)

### New features

### Bug fixes
- `accept_argument` matcher accepts underscored argument names and passes even if the actual argument is camel-cased (https://github.com/khamusa/rspec-graphql_matchers/pull/32 thanks to @TonyArra);
- `have_a_field` matcher accepts `.with_deprecation_reason` (https://github.com/khamusa/rspec-graphql_matchers/pull/34 thanks to @TonyArra).

## 1.2.1 (March 31st, 2020)

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ class PostType < GraphQL::Schema::Object
field :id, ID, null: false
field :comments, [String], null: false
field :isPublished, Boolean, null: true
field :published, Boolean, null: false, deprecation_reason: 'Use isPublished instead'

field :subposts, PostType, null: true do
argument :filter, types.String, required: false
argument :id, types.ID, required: false
argument :isPublished, types.Boolean, required: false
end
end
```
Expand All @@ -64,6 +66,12 @@ describe PostType do
it { is_expected.to have_field(:comments).of_type("[String!]!") }
it { is_expected.to have_field(:isPublished).of_type("Boolean") }

# Check a field is deprecated
it { is_expected.to have_field(:published).with_deprecation_reason }
it { is_expected.to have_field(:published).with_deprecation_reason('Use isPublished instead') }
it { is_expected.not_to have_field(:published).with_deprecation_reason('Wrong reason') }
it { is_expected.not_to have_field(:isPublished).with_deprecation_reason }

# The gem automatically converts field names to CamelCase, so this will
# pass even though the field was defined as field :isPublished
it { is_expected.to have_field(:is_published).of_type("Boolean") }
Expand Down Expand Up @@ -122,6 +130,10 @@ describe PostType do
end

it { is_expected.not_to accept_argument(:weirdo) }

# The gem automatically converts argument names to CamelCase, so this will
# pass even though the argument was defined as :isPublished
it { is_expected.to accept_argument(:is_published).of_type("Boolean") }
end
end
```
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/graphql_matchers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Rspec
module GraphqlMatchers
VERSION = '1.2.1'
VERSION = '1.3.0'
end
end

0 comments on commit f8f89cd

Please sign in to comment.