rspec-json_api 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +13 -0
- data/lib/rspec/json_api/matchers/have_no_content.rb +21 -0
- data/lib/rspec/json_api/matchers/match_json_schema.rb +1 -0
- data/lib/rspec/json_api/matchers.rb +4 -0
- data/lib/rspec/json_api/version.rb +1 -1
- data/lib/rspec/json_api.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 926364f56a7d6913ba3ffc9f3247268727e8510cae6941aa6918f3101c3ecd27
|
4
|
+
data.tar.gz: 272e73fbd9562c005fdb1d3ac50e17cee84aa22e8e0383d0eb15d2d6606dd4c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be67b6d2146f39576b7766e7dc9eeda0ea7530f63e97e5cbb503424d3e95a0b7607e798f09acee83efeadde2e504df74b1dfcd3678082b518024c0d70917066
|
7
|
+
data.tar.gz: 4b723f4a170f36e563e7663c7e22286850ab60f376bd166db4a76476dc2faa3ca08fe055713419498657c5c52f4b6c609e3a8e27fba80c913ef5495ce0ed7932
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-json_api (1.1.
|
4
|
+
rspec-json_api (1.1.1)
|
5
5
|
activesupport (>= 6.1.4.1)
|
6
6
|
rails (>= 6.1.4.1)
|
7
7
|
rspec-rails (>= 5.0.2)
|
@@ -91,16 +91,16 @@ GEM
|
|
91
91
|
mini_mime (1.1.5)
|
92
92
|
mini_portile2 (2.7.1)
|
93
93
|
minitest (5.15.0)
|
94
|
-
net-imap (0.4.
|
94
|
+
net-imap (0.4.9.1)
|
95
95
|
date
|
96
96
|
net-protocol
|
97
97
|
net-pop (0.1.2)
|
98
98
|
net-protocol
|
99
99
|
net-protocol (0.2.2)
|
100
100
|
timeout
|
101
|
-
net-smtp (0.4.0)
|
101
|
+
net-smtp (0.4.0.1)
|
102
102
|
net-protocol
|
103
|
-
nio4r (2.
|
103
|
+
nio4r (2.7.0)
|
104
104
|
nokogiri (1.13.1)
|
105
105
|
mini_portile2 (~> 2.7.0)
|
106
106
|
racc (~> 1.4)
|
data/README.md
CHANGED
@@ -66,6 +66,14 @@ RSpec.describe UsersController, type: :controller do
|
|
66
66
|
expect(response.body).to match_json_schema(expected_schema)
|
67
67
|
end
|
68
68
|
end
|
69
|
+
|
70
|
+
describe '#update' do
|
71
|
+
it 'matches API response' do
|
72
|
+
put :update, params: { name: 'John', age: 35 }
|
73
|
+
|
74
|
+
expect(response.body).to have_no_content
|
75
|
+
end
|
76
|
+
end
|
69
77
|
end
|
70
78
|
```
|
71
79
|
|
@@ -75,6 +83,11 @@ end
|
|
75
83
|
expect(response.body).to match_json_schema(expected_schema)
|
76
84
|
```
|
77
85
|
|
86
|
+
- ### have_no_content
|
87
|
+
```
|
88
|
+
expect(response.body).to have_no_content
|
89
|
+
```
|
90
|
+
|
78
91
|
## Interfaces
|
79
92
|
The gem introduces interfaces to reuse them during test matches.
|
80
93
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module JsonApi
|
5
|
+
module Matchers
|
6
|
+
class HaveNoContent
|
7
|
+
def matches?(actual)
|
8
|
+
actual == ""
|
9
|
+
end
|
10
|
+
|
11
|
+
def failure_message
|
12
|
+
self
|
13
|
+
end
|
14
|
+
|
15
|
+
def failure_message_when_negated
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/rspec/json_api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-json_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Gajowiak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/rspec/json_api/compare_hash.rb
|
86
86
|
- lib/rspec/json_api/interfaces/example_interface.rb
|
87
87
|
- lib/rspec/json_api/matchers.rb
|
88
|
+
- lib/rspec/json_api/matchers/have_no_content.rb
|
88
89
|
- lib/rspec/json_api/matchers/match_json_schema.rb
|
89
90
|
- lib/rspec/json_api/types/email.rb
|
90
91
|
- lib/rspec/json_api/types/uri.rb
|