lookout-rack-utils 1.7.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lookout/rack/utils/subroute.rb +1 -1
- data/lib/lookout/rack/utils/version.rb +1 -1
- data/spec/subroute_spec.rb +22 -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: 6366dda584cb48d5eef7c2e9abc6bfeb1e932fc1
|
4
|
+
data.tar.gz: fb3d7e2240ecc8f1bea64741c06a4abaa17e2131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/spec/subroute_spec.rb
CHANGED
@@ -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:
|
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-
|
12
|
+
date: 2014-12-09 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|