wt-rspec-grape 0.2.0 → 0.3.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 +18 -0
- data/lib/rspec/grape/methods.rb +1 -1
- data/lib/rspec/grape/version.rb +1 -1
- data/lib/wt-rspec-grape.rb +2 -0
- 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: d335b8193d4ac649846cc892cefa101024e3cbb12c7c3298fb298e27af479fc3
|
|
4
|
+
data.tar.gz: c93816828f2c1ae7501991dc4d3e69528810d7de728c63dc44f3de8a4ec44ead
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73bd17120280ce221b3000eb820fba7c4910abfb3e8b7da46c547b50be0e582c6ef51bd0ada045cd3b0023fb815a7923b9a5e9218bcf98aa64fa3e366cbc772e
|
|
7
|
+
data.tar.gz: e7c0d79bdc99367f2d724b917659e3fff3e15b8e2d0d7c17455622d6351a4266c636c0b703b4458d35ee1a3caa998073723904c80bfba3c572b4ed2eb36c86c7
|
data/README.md
CHANGED
|
@@ -50,6 +50,24 @@ Or use a symbol:
|
|
|
50
50
|
describe MyAPI, :api do
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
### Root API
|
|
54
|
+
|
|
55
|
+
By default requests are sent to `described_class`. Since Grape 3.3, mounted APIs no longer inherit helpers, rescue handlers and prefixes from the API they are mounted into, so specs usually need to hit the root API instead. Configure it once in your spec helper:
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
RSpec.configure do |config|
|
|
59
|
+
config.grape_app = API
|
|
60
|
+
end
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Any Rack app works, e.g. `Rails.application`. It can also be overridden per example group with metadata:
|
|
64
|
+
|
|
65
|
+
```ruby
|
|
66
|
+
describe MyAPI, type: :api, grape_app: OtherAPI do
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Defining `app` (or `let(:app)`) in an example group still takes precedence.
|
|
70
|
+
|
|
53
71
|
### Basic usage
|
|
54
72
|
|
|
55
73
|
This gem provides the `call_api` helper method. It automatically reads endpoint url and method from context description, allowing you to avoid duplication and write a shorter spec:
|
data/lib/rspec/grape/methods.rb
CHANGED
data/lib/rspec/grape/version.rb
CHANGED
data/lib/wt-rspec-grape.rb
CHANGED