File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ def create
6565 }
6666 )
6767
68+ add_warning_headers ( build . stack_warnings ) if build . stack_warnings &.any?
69+
6870 render status : :created , json : Presenters ::V3 ::BuildPresenter . new ( build )
6971 rescue BuildCreate ::InvalidPackage => e
7072 bad_request! ( e . message )
Original file line number Diff line number Diff line change 303303 expect ( parsed_response [ 'warnings' ] [ 0 ] [ 'detail' ] ) . to include ( 'deprecated' )
304304 expect ( parsed_response [ 'warnings' ] [ 0 ] [ 'detail' ] ) . to include ( 'cflinuxfs3 stack is deprecated' )
305305 end
306+
307+ it 'includes warming in response headers' do
308+ post '/v3/builds' , create_request . to_json , developer_headers
309+
310+ expect ( last_response . status ) . to eq ( 201 )
311+ expect ( last_response . headers [ 'X-Cf-Warnings' ] ) . to be_present
312+ warning = CGI . unescape ( last_response . headers [ 'X-Cf-Warnings' ] )
313+ expect ( warning ) . to include ( 'deprecated' )
314+ expect ( warning ) . to include ( 'cflinuxfs3 stack is deprecated' )
315+ end
306316 end
307317
308318 context 'app has previous builds' do
322332 expect ( parsed_response [ 'warnings' ] [ 0 ] [ 'detail' ] ) . to include ( 'cflinuxfs3 stack is deprecated' )
323333 expect ( app_model . builds_dataset . count ) . to eq ( 2 )
324334 end
335+
336+ it 'includes warming in response headers' do
337+ post '/v3/builds' , create_request . to_json , developer_headers
338+
339+ expect ( last_response . status ) . to eq ( 201 )
340+ expect ( last_response . headers [ 'X-Cf-Warnings' ] ) . to be_present
341+ warning = CGI . unescape ( last_response . headers [ 'X-Cf-Warnings' ] )
342+ expect ( warning ) . to include ( 'deprecated' )
343+ expect ( warning ) . to include ( 'cflinuxfs3 stack is deprecated' )
344+ end
325345 end
326346 end
327347 end
You can’t perform that action at this time.
0 commit comments