rspec-request_snapshot 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +7 -2
- data/lib/rspec/request_snapshot/config.rb +1 -0
- data/lib/rspec/request_snapshot/handlers/base.rb +2 -1
- data/lib/rspec/request_snapshot/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: d9ab83e5c6e363af7b0fd232652ff9aad21a4e92be390e7b0cd14472efede05f
|
4
|
+
data.tar.gz: '09680d62f5bb393fea32254078ddc280b10ee53627d7840d13fa643d84ef1572'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 525dd5eb810666c52b50235f1cbb31311561121a80a67264d2743026adede323c6327b1eb25527776ca843b3528dce811615f0e9bdae26b3e77e583d5d22aaf7
|
7
|
+
data.tar.gz: 1c2e330b6484c96d63b6f3dec4b942bd57e1f90612553b9a3cccfabca7e5796845d1296f40a1c8d4bc0eb662b8f00708095f483a04a4d2c6814122d7df17f5cf
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -5,8 +5,9 @@ Gold master testing for RSpec API request specs. Make sure API behavior is not c
|
|
5
5
|
By default, snapshots are stored under `spec/fixtures/snapshots` and should be code reviewed as well. The syntax is inspired by Jest.
|
6
6
|
|
7
7
|
References:
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
* [Gold Master Testing article by CodeClimate](https://codeclimate.com/blog/gold-master-testing/)
|
10
|
+
* [Jest Snapshot Testing](https://jestjs.io/docs/en/snapshot-testing)
|
10
11
|
|
11
12
|
## Installation
|
12
13
|
|
@@ -37,6 +38,10 @@ RSpec.configure do |config|
|
|
37
38
|
# The json attributes that you want to ignore when comparing snapshots
|
38
39
|
# Default value is [id, created_at, updated_at]
|
39
40
|
config.request_snapshots_dynamic_attributes = %w(id created_at updated_at)
|
41
|
+
|
42
|
+
# The json attributes that ignore order when comparing nodes
|
43
|
+
# Default value is []
|
44
|
+
config.request_snapshots_ignore_order = %w(array_node)
|
40
45
|
end
|
41
46
|
```
|
42
47
|
|
@@ -2,5 +2,6 @@ module Rspec::RequestSnapshot
|
|
2
2
|
RSpec.configure do |config|
|
3
3
|
config.add_setting :request_snapshots_dir, default: "spec/fixtures/snapshots"
|
4
4
|
config.add_setting :request_snapshots_dynamic_attributes, default: %w(id created_at updated_at)
|
5
|
+
config.add_setting :request_snapshots_ignore_order, default: %w()
|
5
6
|
end
|
6
7
|
end
|