lhs 19.10.0 → 20.0.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/README.md +23 -4
- data/lib/lhs/{test/request_cycle_cache_helper.rb → rspec.rb} +2 -0
- data/lib/lhs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a7bf20f71cff5e170d43991a6bd79ab90fd35e32798663055b074a44d123dc8
|
4
|
+
data.tar.gz: d05a41113ba4e00868cd7c02cb8ca26ff0d0f1ea745ef24f1a8a09771748e42c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0709a3da6db7dcf227254a4aaff48a54a75315ab1a7a281e5ed9ead269a04850a94fb3a906a3192bf86626185af1f0b9f84cd016fb19756f1c9ffa602e6352a4'
|
7
|
+
data.tar.gz: fe62a75e751b4f37215740368a2b68c55a1c130e59e938d5d42b769f1ca4d66f008dde1b2c21dbbc0d9bc1b0cf0bb1492d4385adf0b119e8ef1ec2ff781f63be
|
data/README.md
CHANGED
@@ -1629,6 +1629,15 @@ POST https://service.example.com/records/1z-5r1fkaj { body: "{ 'name': 'Starbuck
|
|
1629
1629
|
|
1630
1630
|
-> See [record validation](#record-validation) for how to handle validation errors when updating records.
|
1631
1631
|
|
1632
|
+
You can also pass explicit request options to `update`, by passing two explicit hashes:
|
1633
|
+
|
1634
|
+
```ruby
|
1635
|
+
# app/controllers/some_controller.rb
|
1636
|
+
|
1637
|
+
record.update({ recommended: true }, { method: 'put' })
|
1638
|
+
|
1639
|
+
```
|
1640
|
+
|
1632
1641
|
##### partial_update
|
1633
1642
|
|
1634
1643
|
`partial_update` updates just the provided parameters.
|
@@ -1660,6 +1669,15 @@ POST https://service.example.com/records/1z-5r1fkaj { body: "{ 'name': 'Starbuck
|
|
1660
1669
|
|
1661
1670
|
-> See [record validation](#record-validation) for how to handle validation errors when updating records.
|
1662
1671
|
|
1672
|
+
You can also pass explicit request options to `partial_update`, by passing two explicit hashes:
|
1673
|
+
|
1674
|
+
```ruby
|
1675
|
+
# app/controllers/some_controller.rb
|
1676
|
+
|
1677
|
+
record.partial_update({ recommended: true }, { method: 'put' })
|
1678
|
+
|
1679
|
+
```
|
1680
|
+
|
1663
1681
|
#### Endpoint url parameter injection during record creation/change
|
1664
1682
|
|
1665
1683
|
LHS injects parameters provided to `create`, `update`, `partial_update`, `save` etc. into an endpoint's URL when matching:
|
@@ -2502,17 +2520,18 @@ it 'displays contracts' do
|
|
2502
2520
|
end
|
2503
2521
|
```
|
2504
2522
|
|
2505
|
-
### Test helper
|
2523
|
+
### Test helper
|
2506
2524
|
|
2507
|
-
In order to
|
2525
|
+
In order to load LHS test helpers into your tests, add the following to your spec helper:
|
2508
2526
|
|
2509
2527
|
```ruby
|
2510
2528
|
# spec/spec_helper.rb
|
2511
2529
|
|
2512
|
-
require 'lhs/
|
2530
|
+
require 'lhs/rspec'
|
2513
2531
|
```
|
2514
2532
|
|
2515
|
-
This will
|
2533
|
+
This e.g. will prevent running into caching issues during your tests, when (request cycle cache)[#request-cycle-cache] is enabled.
|
2534
|
+
It will initialize a MemoryStore cache for LHC::Caching interceptor and resets the cache before every test.
|
2516
2535
|
|
2517
2536
|
### Test query chains
|
2518
2537
|
|
data/lib/lhs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 20.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhs/graphs/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -300,7 +300,7 @@ files:
|
|
300
300
|
- lib/lhs/proxy.rb
|
301
301
|
- lib/lhs/railtie.rb
|
302
302
|
- lib/lhs/record.rb
|
303
|
-
- lib/lhs/
|
303
|
+
- lib/lhs/rspec.rb
|
304
304
|
- lib/lhs/unprocessable.rb
|
305
305
|
- lib/lhs/version.rb
|
306
306
|
- script/ci/build.sh
|