@@ -1260,7 +1260,10 @@ def check_filtered_instances(*instances)
12601260 expect ( last_response ) . to have_status_code ( 422 )
12611261 expect ( parsed_response [ 'errors' ] ) . to include (
12621262 include ( {
1263- 'detail' => 'Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.' ,
1263+ 'detail' => 'Invalid service plan. This could be due to a space-scoped broker which is offering the service plan ' \
1264+ "'#{ service_plan . name } ' with guid '#{ service_plan . guid } ' in another space or that the plan " \
1265+ 'is not enabled in this organization. Ensure that the service plan is visible in your current space ' \
1266+ "'#{ space . name } ' with guid '#{ space . guid } '." ,
12641267 'title' => 'CF-UnprocessableEntity' ,
12651268 'code' => 10_008
12661269 } )
@@ -1276,7 +1279,9 @@ def check_filtered_instances(*instances)
12761279 expect ( last_response ) . to have_status_code ( 422 )
12771280 expect ( parsed_response [ 'errors' ] ) . to include (
12781281 include ( {
1279- 'detail' => 'Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.' ,
1282+ 'detail' => "Invalid service plan. The service plan '#{ service_plan . name } ' with guid '#{ service_plan . guid } ' " \
1283+ "has been removed from the service broker's catalog. " \
1284+ 'It is not possible to create new service instances using this plan.' ,
12801285 'title' => 'CF-UnprocessableEntity' ,
12811286 'code' => 10_008
12821287 } )
@@ -2404,6 +2409,26 @@ def check_filtered_instances(*instances)
24042409 end
24052410 end
24062411
2412+ context 'not enabled in that org' do
2413+ let ( :service_plan ) { VCAP ::CloudController ::ServicePlan . make ( public : false , active : true ) }
2414+ let ( :service_plan_guid ) { service_plan . guid }
2415+
2416+ it 'fails saying the plan is invalid' do
2417+ api_call . call ( admin_headers )
2418+ expect ( last_response ) . to have_status_code ( 422 )
2419+ expect ( parsed_response [ 'errors' ] ) . to include (
2420+ include ( {
2421+ 'detail' => 'Invalid service plan. This could be due to a space-scoped broker which is offering the service plan ' \
2422+ "'#{ service_plan . name } ' with guid '#{ service_plan . guid } ' in another space or that the plan " \
2423+ 'is not enabled in this organization. Ensure that the service plan is visible in your current space ' \
2424+ "'#{ space . name } ' with guid '#{ space . guid } '." ,
2425+ 'title' => 'CF-UnprocessableEntity' ,
2426+ 'code' => 10_008
2427+ } )
2428+ )
2429+ end
2430+ end
2431+
24072432 context 'not available' do
24082433 let ( :service_plan ) { VCAP ::CloudController ::ServicePlan . make ( public : true , active : false ) }
24092434 let ( :service_plan_guid ) { service_plan . guid }
@@ -2413,7 +2438,9 @@ def check_filtered_instances(*instances)
24132438 expect ( last_response ) . to have_status_code ( 422 )
24142439 expect ( parsed_response [ 'errors' ] ) . to include (
24152440 include ( {
2416- 'detail' => 'Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.' ,
2441+ 'detail' => "Invalid service plan. The service plan '#{ service_plan . name } ' with guid '#{ service_plan . guid } ' " \
2442+ "has been removed from the service broker's catalog. " \
2443+ 'It is not possible to create new service instances using this plan.' ,
24172444 'title' => 'CF-UnprocessableEntity' ,
24182445 'code' => 10_008
24192446 } )
0 commit comments