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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84187d80aed805aa3706e76d067fae5fb31aef33
4
- data.tar.gz: 85390f609229108303780090149d356cea29e5e4
3
+ metadata.gz: 335ef9b8b3367c50f0a8ec8adfb71fc59f876c55
4
+ data.tar.gz: d06103497a65d53728bb9318d529509c0dc46173
5
5
  SHA512:
6
- metadata.gz: ab47fd9dcb3c32afb4f996173d7abedb22fd0f87db8d2b3546e1a9cd8648b11adbe3607a952371e25573642afb30298137b679aee89d4c2c4228d1a104439c6e
7
- data.tar.gz: 9c1fc648a9ffe22b649ab3774154b174ef8e84262aa03aabde937d8bc424382b4e7cc38cd15d2b845cd957992731f4f699d8e70471ec38f08c2879ddd464af09
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
+ ```
@@ -20,7 +20,7 @@ module RSpec
20
20
 
21
21
  path_params.each { |param| let(param.to_sym) { send(param.to_sym) } }
22
22
 
23
- subject { send(method.to_sym, send(:path), params) }
23
+ subject(:make_request) { send(method.to_sym, send(:path), params) }
24
24
 
25
25
  class_eval(&block)
26
26
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Endpoint
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.2
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-19 00:00:00.000000000 Z
11
+ date: 2016-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core