api-model 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/api-model.gemspec +1 -1
- data/lib/api_model/class_methods.rb +1 -1
- data/spec/api-model/http_request_spec.rb +11 -0
- 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: 67b49931f63da3d0513936563bbd57b3d0d748d1
|
4
|
+
data.tar.gz: 35ac10fb3187252443df74c7e5d36efdb31ffdc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 593efe9fb7d5b3411400ac81269938bcffe17515c185f9c7724483d79195f1cb0401e6ff86b95a6157c19afe8863dbab55d446a0e312ad53b8083c5215ba946b
|
7
|
+
data.tar.gz: 8970ca96cb6f76534fe2d5a312c9e9aed4c49f784ec6c8fcfb631dfa303ceb704d95848ddad43b58e32aa648e55c69664eab5e60be2192a1f16ca87b92fc5fa0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
api-model (2.2.
|
4
|
+
api-model (2.2.3)
|
5
5
|
activemodel (~> 4.1)
|
6
6
|
activesupport (~> 4.1)
|
7
7
|
hash-pipe (~> 0.0)
|
@@ -12,10 +12,10 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activemodel (4.1.
|
16
|
-
activesupport (= 4.1.
|
15
|
+
activemodel (4.1.7)
|
16
|
+
activesupport (= 4.1.7)
|
17
17
|
builder (~> 3.1)
|
18
|
-
activesupport (4.1.
|
18
|
+
activesupport (4.1.7)
|
19
19
|
i18n (~> 0.6, >= 0.6.9)
|
20
20
|
json (~> 1.7, >= 1.7.7)
|
21
21
|
minitest (~> 5.1)
|
@@ -35,12 +35,12 @@ GEM
|
|
35
35
|
descendants_tracker (0.0.4)
|
36
36
|
thread_safe (~> 0.3, >= 0.3.1)
|
37
37
|
diff-lcs (1.2.5)
|
38
|
-
domain_name (0.5.
|
38
|
+
domain_name (0.5.22)
|
39
39
|
unf (>= 0.0.5, < 1.0.0)
|
40
40
|
equalizer (0.0.9)
|
41
41
|
ethon (0.7.1)
|
42
42
|
ffi (>= 1.3.0)
|
43
|
-
ffi (1.9.
|
43
|
+
ffi (1.9.6)
|
44
44
|
hash-pipe (0.0.2)
|
45
45
|
activesupport (~> 4.1)
|
46
46
|
http-cookie (1.0.2)
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
ice_nine (0.11.0)
|
50
50
|
json (1.8.1)
|
51
51
|
method_source (0.8.2)
|
52
|
-
minitest (5.4.
|
52
|
+
minitest (5.4.3)
|
53
53
|
pry (0.9.12.2)
|
54
54
|
coderay (~> 1.0.5)
|
55
55
|
method_source (~> 0.8)
|
data/api-model.gemspec
CHANGED
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "api-model"
|
5
|
-
s.version = "2.2.
|
5
|
+
s.version = "2.2.3"
|
6
6
|
s.authors = ["Damien Timewell", "Erik Rothoff Andersson"]
|
7
7
|
s.email = ["mail@damientimewell.com", "erik.rothoff@gmail.com"]
|
8
8
|
s.licenses = ['MIT']
|
@@ -29,7 +29,7 @@ module ApiModel
|
|
29
29
|
cache cache_id(path, options) do
|
30
30
|
request = HttpRequest.new path: path, method: method, config: api_model_configuration
|
31
31
|
request.builder = options.delete(:builder) || api_model_configuration.builder || self
|
32
|
-
request.options.
|
32
|
+
request.options.deep_merge! options
|
33
33
|
request.run.build_objects
|
34
34
|
end
|
35
35
|
end
|
@@ -58,6 +58,17 @@ describe ApiModel::HttpRequest do
|
|
58
58
|
it 'should use the default accept header' do
|
59
59
|
request_headers["Accept"].should eq ApiModel::Configuration.new.headers["Accept"]
|
60
60
|
end
|
61
|
+
|
62
|
+
it 'should retain the default headers when making requests with custom headers added' do
|
63
|
+
BlogPost.api_config { |config| config.host = "http://api-model-specs.com" }
|
64
|
+
custom_headers = { headers: { "Custom" => "Header" } }
|
65
|
+
blog_post = VCR.use_cassette('posts') { BlogPost.get_json "/single_post", {}, custom_headers }
|
66
|
+
headers = blog_post.http_response.api_call.request.options[:headers]
|
67
|
+
|
68
|
+
headers.should have_key "Custom"
|
69
|
+
headers.should have_key "Accept"
|
70
|
+
headers.should have_key "Content-Type"
|
71
|
+
end
|
61
72
|
end
|
62
73
|
|
63
74
|
describe "sending a GET request" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damien Timewell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|