Skip to content

Commit f8f89cd

Browse files
committed
Version 1.3.0
1 parent 75aae2f commit f8f89cd

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Changelog
22

3-
### Breaking changes
4-
5-
### Deprecations
3+
## 1.3.0 (May 7th, 2020)
64

7-
### New features
8-
9-
### Bug fixes
5+
- `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);
6+
- `have_a_field` matcher accepts `.with_deprecation_reason` (https://github.com/khamusa/rspec-graphql_matchers/pull/34 thanks to @TonyArra).
107

118
## 1.2.1 (March 31st, 2020)
129

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ class PostType < GraphQL::Schema::Object
4646
field :id, ID, null: false
4747
field :comments, [String], null: false
4848
field :isPublished, Boolean, null: true
49+
field :published, Boolean, null: false, deprecation_reason: 'Use isPublished instead'
4950

5051
field :subposts, PostType, null: true do
5152
argument :filter, types.String, required: false
5253
argument :id, types.ID, required: false
54+
argument :isPublished, types.Boolean, required: false
5355
end
5456
end
5557
```
@@ -64,6 +66,12 @@ describe PostType do
6466
it { is_expected.to have_field(:comments).of_type("[String!]!") }
6567
it { is_expected.to have_field(:isPublished).of_type("Boolean") }
6668

69+
# Check a field is deprecated
70+
it { is_expected.to have_field(:published).with_deprecation_reason }
71+
it { is_expected.to have_field(:published).with_deprecation_reason('Use isPublished instead') }
72+
it { is_expected.not_to have_field(:published).with_deprecation_reason('Wrong reason') }
73+
it { is_expected.not_to have_field(:isPublished).with_deprecation_reason }
74+
6775
# The gem automatically converts field names to CamelCase, so this will
6876
# pass even though the field was defined as field :isPublished
6977
it { is_expected.to have_field(:is_published).of_type("Boolean") }
@@ -122,6 +130,10 @@ describe PostType do
122130
end
123131

124132
it { is_expected.not_to accept_argument(:weirdo) }
133+
134+
# The gem automatically converts argument names to CamelCase, so this will
135+
# pass even though the argument was defined as :isPublished
136+
it { is_expected.to accept_argument(:is_published).of_type("Boolean") }
125137
end
126138
end
127139
```

lib/rspec/graphql_matchers/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Rspec
44
module GraphqlMatchers
5-
VERSION = '1.2.1'
5+
VERSION = '1.3.0'
66
end
77
end

0 commit comments

Comments
 (0)