|
16 | 16 |
|
17 | 17 | it 'returns an error with :missing_primary_runtime payload' do |
18 | 18 | expect(service_response).to be_error |
19 | | - expect(service_response.payload).to eq(:missing_primary_runtime) |
| 19 | + expect(service_response.payload[:error_code]).to eq(:missing_primary_runtime) |
20 | 20 | end |
21 | 21 | end |
22 | 22 |
|
|
27 | 27 |
|
28 | 28 | it 'returns missing_datatypes error' do |
29 | 29 | expect(service_response.error?).to be true |
30 | | - expect(service_response.payload).to eq(:missing_definition) |
| 30 | + expect(service_response.payload[:error_code]).to eq(:missing_definition) |
31 | 31 | end |
32 | 32 | end |
33 | 33 |
|
34 | | - context 'when a data type version is newer on runtime than primary (outdated primary)' do |
| 34 | + context 'when secondary runtime has outdated definitions' do |
35 | 35 | before do |
36 | | - create(:data_type, runtime: primary_runtime, identifier: 'dt1', version: '1.1.0') |
| 36 | + create(:data_type, runtime: primary_runtime, identifier: 'dt1', version: '1.3.0') |
37 | 37 | create(:data_type, runtime: runtime, identifier: 'dt1', version: '1.2.0') |
38 | 38 | end |
39 | 39 |
|
40 | 40 | it 'returns outdated_data_type error' do |
41 | 41 | expect(service_response.error?).to be true |
42 | | - expect(service_response.payload).to eq(:outdated_definition) |
| 42 | + expect(service_response.payload[:error_code]).to eq(:outdated_definition) |
43 | 43 | end |
44 | 44 | end |
45 | 45 |
|
46 | 46 | context 'when all models are compatible' do |
47 | 47 | before do |
48 | | - create(:data_type, runtime: primary_runtime, identifier: 'dt1', version: '1.2.0') |
49 | | - create(:data_type, runtime: runtime, identifier: 'dt1', version: '1.1.0') |
| 48 | + create(:data_type, runtime: primary_runtime, identifier: 'dt1', version: '1.3.0') |
| 49 | + create(:data_type, runtime: runtime, identifier: 'dt1', version: '1.3.0') |
50 | 50 | create(:flow_type, runtime: primary_runtime, identifier: 'ft1', version: '2.1.0') |
51 | | - create(:flow_type, runtime: runtime, identifier: 'ft1', version: '2.0.0') |
52 | | - create(:runtime_function_definition, runtime_name: 'rfd1', runtime: primary_runtime, version: '3.2.0') |
| 51 | + create(:flow_type, runtime: runtime, identifier: 'ft1', version: '2.2.0') |
| 52 | + create(:runtime_function_definition, runtime_name: 'rfd1', runtime: primary_runtime, version: '3.0.0') |
53 | 53 | create(:runtime_function_definition, runtime_name: 'rfd1', runtime: runtime, version: '3.1.0') |
54 | 54 | end |
55 | 55 |
|
|
0 commit comments