diff --git a/spec/request/space_manifests_spec.rb b/spec/request/space_manifests_spec.rb index 6115557208..54d0030312 100644 --- a/spec/request/space_manifests_spec.rb +++ b/spec/request/space_manifests_spec.rb @@ -218,6 +218,36 @@ ) end + + context 'when the manifest contains valid binary-encoded URL(s) for the buildpack(s)' do + let(:app1_model) { VCAP::CloudController::AppModel.make(name: '🦄🦄🦄', space: space) } + let(:yml_manifest_with_binary_valid_buildpacks) do + "--- + applications: + - name: #{app1_model.name} + buildpacks: + - !!binary |- + aHR0cHM6Ly9naXRodWIuY29tL2Nsb3VkZm91bmRyeS9uZ2lueC1idWlsZHBhY2suZ2l0 + - !!binary |- + aHR0cHM6Ly9naXRodWIuY29tL2J1aWxkcGFja3MvbXktc3BlY2lhbC1idWlsZHBhY2s=" + end + + it 'applies the manifest' do + post "/v3/spaces/#{space.guid}/actions/apply_manifest", yml_manifest_with_binary_valid_buildpacks, yml_headers(user_header) + expect(last_response.status).to eq(202) + job_guid = VCAP::CloudController::PollableJobModel.last.guid + expect(last_response.headers['Location']).to match(%r{/v3/jobs/#{job_guid}}) + + Delayed::Worker.new.work_off + expect(VCAP::CloudController::PollableJobModel.find(guid: job_guid)).to be_complete, VCAP::CloudController::PollableJobModel.find(guid: job_guid).cf_api_error + + app1_model.reload + lifecycle_data = app1_model.lifecycle_data + expect(lifecycle_data.buildpacks.first).to include('https://github.com/cloudfoundry/nginx-buildpack.git') + expect(lifecycle_data.buildpacks.second).to include('https://github.com/buildpacks/my-special-buildpack') + end + end + context 'service bindings' do let(:client) { instance_double(VCAP::Services::ServiceBrokers::V2::Client, bind: {}) }