|
976 | 976 | ) |
977 | 977 | end |
978 | 978 | let(:guid) { binding.guid } |
| 979 | + let(:labels) { { name: 'foo' } } |
| 980 | + let(:annotations) { { contact: 'foo@example.com' } } |
| 981 | + |
| 982 | + before do |
| 983 | + VCAP::CloudController::LabelsUpdate.update(binding, labels, VCAP::CloudController::RouteBindingLabelModel) |
| 984 | + VCAP::CloudController::AnnotationsUpdate.update(binding, annotations, VCAP::CloudController::RouteBindingAnnotationModel) |
| 985 | + end |
979 | 986 |
|
980 | 987 | context 'user-provided service instance' do |
981 | 988 | let(:service_instance) { VCAP::CloudController::UserProvidedServiceInstance.make(space: space, route_service_url: route_service_url) } |
|
984 | 991 | let(:db_check) { |
985 | 992 | lambda do |
986 | 993 | expect(VCAP::CloudController::RouteBinding.all).to be_empty |
| 994 | + expect(VCAP::CloudController::RouteBindingLabelModel.all).to be_empty |
| 995 | + expect(VCAP::CloudController::RouteBindingAnnotationModel.all).to be_empty |
987 | 996 | end |
988 | 997 | } |
989 | 998 |
|
|
1051 | 1060 | end |
1052 | 1061 |
|
1053 | 1062 | context 'when the unbind completes synchronously' do |
1054 | | - it 'removes the binding' do |
| 1063 | + it 'removes the binding the associated metadata' do |
1055 | 1064 | execute_all_jobs(expected_successes: 1, expected_failures: 0) |
1056 | 1065 |
|
1057 | 1066 | expect(VCAP::CloudController::RouteBinding.all).to be_empty |
| 1067 | + expect(VCAP::CloudController::RouteBindingLabelModel.all).to be_empty |
| 1068 | + expect(VCAP::CloudController::RouteBindingAnnotationModel.all).to be_empty |
1058 | 1069 | end |
1059 | 1070 |
|
1060 | 1071 | it 'completes the job' do |
|
1137 | 1148 | let(:state) { 'succeeded' } |
1138 | 1149 | let(:last_operation_status_code) { 200 } |
1139 | 1150 |
|
1140 | | - it 'removes the binding' do |
| 1151 | + it 'removes the binding and its associated metadata' do |
1141 | 1152 | execute_all_jobs(expected_successes: 1, expected_failures: 0) |
1142 | 1153 |
|
1143 | 1154 | expect(VCAP::CloudController::RouteBinding.all).to be_empty |
| 1155 | + expect(VCAP::CloudController::RouteBindingLabelModel.all).to be_empty |
| 1156 | + expect(VCAP::CloudController::RouteBindingAnnotationModel.all).to be_empty |
1144 | 1157 | end |
1145 | 1158 |
|
1146 | 1159 | it 'completes the job' do |
|
1154 | 1167 | let(:last_operation_status_code) { 410 } |
1155 | 1168 | let(:last_operation_body) { {} } |
1156 | 1169 |
|
1157 | | - it 'removes the binding' do |
| 1170 | + it 'removes the binding and its associated metadata' do |
1158 | 1171 | execute_all_jobs(expected_successes: 1, expected_failures: 0) |
1159 | 1172 |
|
1160 | 1173 | expect(VCAP::CloudController::RouteBinding.all).to be_empty |
| 1174 | + expect(VCAP::CloudController::RouteBindingLabelModel.all).to be_empty |
| 1175 | + expect(VCAP::CloudController::RouteBindingAnnotationModel.all).to be_empty |
1161 | 1176 | end |
1162 | 1177 |
|
1163 | 1178 | it 'completes the job' do |
|
1178 | 1193 | execute_all_jobs(expected_successes: 0, expected_failures: 1) |
1179 | 1194 |
|
1180 | 1195 | expect(VCAP::CloudController::RouteBinding.all).not_to be_empty |
| 1196 | + expect(VCAP::CloudController::RouteBindingLabelModel.all).not_to be_empty |
| 1197 | + expect(VCAP::CloudController::RouteBindingAnnotationModel.all).not_to be_empty |
1181 | 1198 | end |
1182 | 1199 |
|
1183 | 1200 | it 'puts the error details in the job' do |
|
0 commit comments