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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98036ed122ea1f0d6abcc97dcf423ecec853dace
4
- data.tar.gz: 2251640779097043065e416df0337773784480b8
3
+ metadata.gz: 67b49931f63da3d0513936563bbd57b3d0d748d1
4
+ data.tar.gz: 35ac10fb3187252443df74c7e5d36efdb31ffdc4
5
5
  SHA512:
6
- metadata.gz: 8de2ab9fd9e1d0ffb7f45b0cdeb5bbc7934e724f800611a9d5cc8355d74272b0e93ef87ad68910b7ccde873f7a1343b4ba4a308960a81e30434e24ed51ce0f05
7
- data.tar.gz: bc558bd49e817bd369091d4508e4754ef8d426be296af25c78bb729e6b3135543ef13bdd6a7f288b964d242d24a2adcb8a58b05d6bed2b7d4f096031ca9e9760
6
+ metadata.gz: 593efe9fb7d5b3411400ac81269938bcffe17515c185f9c7724483d79195f1cb0401e6ff86b95a6157c19afe8863dbab55d446a0e312ad53b8083c5215ba946b
7
+ data.tar.gz: 8970ca96cb6f76534fe2d5a312c9e9aed4c49f784ec6c8fcfb631dfa303ceb704d95848ddad43b58e32aa648e55c69664eab5e60be2192a1f16ca87b92fc5fa0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api-model (2.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.5)
16
- activesupport (= 4.1.5)
15
+ activemodel (4.1.7)
16
+ activesupport (= 4.1.7)
17
17
  builder (~> 3.1)
18
- activesupport (4.1.5)
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.20)
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.3)
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.0)
52
+ minitest (5.4.3)
53
53
  pry (0.9.12.2)
54
54
  coderay (~> 1.0.5)
55
55
  method_source (~> 0.8)
@@ -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.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.merge! 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.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-08-28 00:00:00.000000000 Z
12
+ date: 2014-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport