lookout-rack-utils 1.7.3 → 2.0.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: e8791782408e3d3d1616e35b58516311f33cb9a3
4
- data.tar.gz: 442cae22463e00ecb77170bd42fe697e290fe84c
3
+ metadata.gz: 6366dda584cb48d5eef7c2e9abc6bfeb1e932fc1
4
+ data.tar.gz: fb3d7e2240ecc8f1bea64741c06a4abaa17e2131
5
5
  SHA512:
6
- metadata.gz: bd663570f1421211bd9d814104515d8c52032a0546a9906e2ac3c3e02dc477579f15df62dd6497d202da63a5e72890a8f0b39497e5e47f13b7cf67e8e510abd0
7
- data.tar.gz: bd848e038099d5014d413edec6241e91ae174026b99ee99db95f69913b7977873fb42cf2a0e57da0f292733f6c5257e010dfc8c4f8c1de83189c0518551f20e8
6
+ metadata.gz: 11f169441f381f726c248cfa1e251aaf9b5dd77fdc7c7467d0eec8978ad14d0a4f3af154b7cad246db40efd2c477cdc29444684bb1b011fd72c55e6ae717ce1f
7
+ data.tar.gz: dad64c23723a0863390c8057ac2dce9b1fe5adf1f136f98c014334fea045781d5f529729d0eab58695331604f772a57a56ff921f33e061c5ee3cf44e76ccc83c
@@ -20,7 +20,7 @@ module Lookout::Rack::Utils
20
20
  # call will dup the app instance and then call!, so skip Sinatra's dup
21
21
  # since we've done that here.
22
22
  subcode, subheaders, body = subserver.call!(env.merge(request_opts))
23
- return [subcode, body.first]
23
+ return [subcode, subheaders, body.first]
24
24
  end
25
25
 
26
26
  # Returns true if the status given is 20x
@@ -1,7 +1,7 @@
1
1
  module Lookout
2
2
  module Rack
3
3
  module Utils
4
- VERSION = "1.7.3"
4
+ VERSION = "2.0.0"
5
5
  end
6
6
  end
7
7
  end
@@ -35,6 +35,17 @@ describe Lookout::Rack::Utils::Subroute, :type => :route do
35
35
  subroute!('/test_delete', :request_method => 'DELETE')
36
36
  subroute!('/test_route', :id => 1)
37
37
  end
38
+
39
+ get '/header_change' do
40
+ headers 'Content-Disposition' => "attachment;filename=file.txt",
41
+ 'Content-Type' => 'application/octet-stream'
42
+ status 201
43
+ end
44
+
45
+ get '/change_header' do
46
+ subroute!('/header_change')
47
+ end
48
+
38
49
  end
39
50
  end
40
51
 
@@ -92,6 +103,17 @@ describe Lookout::Rack::Utils::Subroute, :type => :route do
92
103
  end
93
104
  end
94
105
  end
106
+
107
+ context 'when the subroute changes the headers' do
108
+ subject(:subrouted) { get "/change_header" }
109
+
110
+ its(:status) { should be 201 }
111
+
112
+ it 'should return the headers set by the subroute' do
113
+ expect(subrouted.headers['Content-Disposition']).to eql("attachment;filename=file.txt")
114
+ expect(subrouted.headers['Content-Type']).to eql('application/octet-stream')
115
+ end
116
+ end
95
117
  end
96
118
 
97
119
  describe '#succeeded?' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-rack-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Smith
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2014-10-16 00:00:00 Z
12
+ date: 2014-12-09 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler