shoulda_render_json 0.0.2 → 0.0.3
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/README.md +4 -4
- data/lib/shoulda_render_json/version.rb +1 -1
- data/lib/shoulda_render_json_object_matcher.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef78bccba9029da99a14deda88d8df69528c2c0e
|
4
|
+
data.tar.gz: 195b6cc8095378f6da8f1494e0281cab7e6b0bab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5892283c8f0049f8ba6c788ecea795973f3529b8f840ace30fb5ecab1278d59d7bdaf27f807da46170cd8c7cc9d24fbf96006327c9adf413e9124666208d293
|
7
|
+
data.tar.gz: 63acf880413fa8a69f0989f377c69f7b4523822275b3056ecb8cb404cfba139307c99b37b16bb034ad9f0c9c11a018626a4b0f2612de3656dc7eb971c720c322
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Shoulda RenderJson
|
1
|
+
# Shoulda RenderJson [](https://codeclimate.com/github/rsl/shoulda_render_json)
|
2
2
|
|
3
3
|
Shoulda macros for making very basic assertions about JSON responses
|
4
4
|
|
@@ -21,7 +21,7 @@ Or install it yourself as:
|
|
21
21
|
I'm going to presume you're already familiar with using Shoulda macros.
|
22
22
|
The most basic assertion for `render_json` will be that your response's content-type is
|
23
23
|
'application/json' (Rails' default JSON content-type) and that there is a root-level node
|
24
|
-
named "foo" in the JSON.
|
24
|
+
named "foo" in the JSON.
|
25
25
|
|
26
26
|
```ruby
|
27
27
|
should render_json('foo')
|
@@ -43,13 +43,13 @@ should render_json('foo', required: %w{bar baz})
|
|
43
43
|
```
|
44
44
|
|
45
45
|
Sometimes, you may need to make assertions on Arrays inside JSON responses and not just Hash/Objects.
|
46
|
-
I've got you covered there too.
|
46
|
+
I've got you covered there too.
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
should render_json('foo', type: Array)
|
50
50
|
```
|
51
51
|
|
52
|
-
If you need to make assertions on the members of that Array, you can use the same `required` and
|
52
|
+
If you need to make assertions on the members of that Array, you can use the same `required` and
|
53
53
|
`forbidden` options but be aware these assertions will be expected to be true for *every* member
|
54
54
|
of the Array. If you've got members that violate this, you'll probably be better off writing custom
|
55
55
|
assertions anyhow.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoulda_render_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RSL
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|