@@ -1123,6 +1123,28 @@ def stub_delete_and_return(status, body)
1123
1123
end
1124
1124
end
1125
1125
1126
+ describe 'GET' , '/v2/managed_service_instances' do
1127
+ let ( :service_instance ) { ManagedServiceInstance . make ( gateway_name : Sham . name ) }
1128
+ let ( :space ) { service_instance . space }
1129
+ let ( :developer ) { make_developer_for_space ( space ) }
1130
+
1131
+ it 'is deprecated' do
1132
+ set_current_user ( developer )
1133
+ get '/v2/managed_service_instances'
1134
+ expect ( last_response ) . to be_a_deprecated_response
1135
+ end
1136
+
1137
+ it 'behaves the same as /v2/service_instances/' do
1138
+ set_current_user ( developer )
1139
+ get '/v2/managed_service_instances'
1140
+ deprecated_response = last_response
1141
+ expect ( deprecated_response ) . to have_status_code ( 200 )
1142
+ get '/v2/service_instances'
1143
+ new_response = last_response
1144
+ expect ( new_response . body ) . to eq ( deprecated_response . body )
1145
+ end
1146
+ end
1147
+
1126
1148
describe 'GET /v2/service_instances' do
1127
1149
context 'dashboard_url' do
1128
1150
let ( :service_instance ) { ManagedServiceInstance . make ( gateway_name : Sham . name ) }
@@ -1535,6 +1557,29 @@ def stub_delete_and_return(status, body)
1535
1557
end
1536
1558
end
1537
1559
1560
+ describe 'GET' , '/v2/managed_service_instances/:guid' do
1561
+ let ( :space ) { Space . make }
1562
+ let ( :developer ) { make_developer_for_space ( space ) }
1563
+ let ( :service_instance ) { ManagedServiceInstance . make ( space :) }
1564
+ let ( :service_plan ) { ServicePlan . make ( active : false ) }
1565
+
1566
+ it 'is deprecated' do
1567
+ set_current_user ( developer )
1568
+ get "v2/managed_service_instances/#{ service_instance . guid } "
1569
+ expect ( last_response ) . to be_a_deprecated_response
1570
+ end
1571
+
1572
+ it 'behaves the same as /v2/service_instances/:guid' do
1573
+ set_current_user ( developer )
1574
+ get "v2/managed_service_instances/#{ service_instance . guid } "
1575
+ deprecated_response = last_response
1576
+ expect ( deprecated_response ) . to have_status_code ( 200 )
1577
+ get "v2/service_instances/#{ service_instance . guid } "
1578
+ new_response = last_response
1579
+ expect ( new_response . body ) . to eq ( deprecated_response . body )
1580
+ end
1581
+ end
1582
+
1538
1583
describe 'GET /v2/service_instances/:service_instance_guid' do
1539
1584
let ( :space ) { service_instance . space }
1540
1585
let ( :developer ) { make_developer_for_space ( space ) }
0 commit comments