rspec-graphql_types 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +21 -2
- data/lib/rspec/graphql_types/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1596709357391d9e80574a97b001b5f89c723bdabba92dccf88e0daa60954a43
|
4
|
+
data.tar.gz: 710ad591c617d535ab6fe68d7536609d99db0d7792175d1bf034a4bd45cb479d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63ad7315cb6d03dfec2e98e4e0c2b59a973817c7f3f04ba340c9bd46c9c92affd173883df63959810b35515edc1f25757ab818df6cd09e79614f651f86a08a2d
|
7
|
+
data.tar.gz: 9dfbdf7b1581f0a4d8516386bad2ed6350586804396a3ccd94f55b26761fd96a9de6cb5218a95c9ecb125ac0b68418c63ac458a8540ec9d2e44920d40e756f65
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,9 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
|
12
|
+
group :development, :test do
|
13
|
+
gem 'rspec-graphql_types'
|
14
|
+
end
|
13
15
|
```
|
14
16
|
|
15
17
|
And then execute:
|
@@ -22,7 +24,24 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
Add the following to your rails_helper.rb
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
RSpec.configure do |config|
|
31
|
+
config.include Rspec::GraphQLTypes, type: :graphql_type
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
Then you can write tests as follows
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
RSpec.describe Types::MyType, type: :graphql_type do
|
39
|
+
it "does something awesome" do
|
40
|
+
object = graphql_object(Types::MyTypes, {passed: in})
|
41
|
+
expect(graphql_field(object, :field_name, arg1: value1, arg2: value2)).to eq("The Result")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
```
|
26
45
|
|
27
46
|
## Development
|
28
47
|
|