@@ -1261,7 +1261,7 @@ def check_filtered_instances(*instances)
12611261 expect ( parsed_response [ 'errors' ] ) . to include (
12621262 include ( {
12631263 '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 " \
1264+ "'#{ service_plan . name } ' with guid '#{ service_plan . guid } ' in another space or that the plan " \
12651265 'is not enabled in this organization. Ensure that the service plan is visible in your current space ' \
12661266 "'#{ space . name } ' with guid '#{ space . guid } '." ,
12671267 'title' => 'CF-UnprocessableEntity' ,
@@ -2409,6 +2409,26 @@ def check_filtered_instances(*instances)
24092409 end
24102410 end
24112411
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+
24122432 context 'not available' do
24132433 let ( :service_plan ) { VCAP ::CloudController ::ServicePlan . make ( public : true , active : false ) }
24142434 let ( :service_plan_guid ) { service_plan . guid }
0 commit comments