rspec-endpoint 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/rspec/endpoint.rb +1 -1
- data/lib/rspec/endpoint/version.rb +1 -1
- 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: 335ef9b8b3367c50f0a8ec8adfb71fc59f876c55
|
4
|
+
data.tar.gz: d06103497a65d53728bb9318d529509c0dc46173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7091d00e594932fd03caf6ff28463736365a19e1d10b8d7dd28c109c124d8f856dbb41360664e011e6116cab62e5653793eb0bb17dcfb7ed066c4408d5a06177
|
7
|
+
data.tar.gz: cb9ea8eb5387320c7e417f998f749dd65d662ae2e7861bbb1724e14ada0b31415c4c674a53bc57986df7f3b4b51b398b0b891999ba52e15d153c56e0df982900
|
data/README.md
CHANGED
@@ -38,3 +38,23 @@ RSpec.descripe UserApi do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
```
|
41
|
+
|
42
|
+
`rspec-endpoint` will define a named subject `make_request` which calls the provided path using the http verb.
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
RSpec.descripe UserApi do
|
46
|
+
endpoint "POST /users/:user_id" do
|
47
|
+
let(:user_id) { 10 }
|
48
|
+
|
49
|
+
it do
|
50
|
+
# Named subject, same as:
|
51
|
+
# post path, params
|
52
|
+
#
|
53
|
+
# `params` here is `{ user_id: user_id }`
|
54
|
+
make_request
|
55
|
+
|
56
|
+
expect(response).to be_success
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
```
|
data/lib/rspec/endpoint.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-endpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Navarro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-core
|