|
1251 | 1251 |
|
1252 | 1252 | it 'should return global holdouts that do not exclude the flag' do |
1253 | 1253 | holdouts = config_with_holdouts.get_holdouts_for_flag('multi_variate_feature') |
1254 | | - expect(holdouts.length).to eq(2) |
| 1254 | + expect(holdouts.length).to eq(3) |
1255 | 1255 |
|
1256 | 1256 | global_holdout = holdouts.find { |h| h['key'] == 'global_holdout' } |
1257 | 1257 | expect(global_holdout).not_to be_nil |
|
1264 | 1264 |
|
1265 | 1265 | it 'should not return global holdouts that exclude the flag' do |
1266 | 1266 | holdouts = config_with_holdouts.get_holdouts_for_flag('boolean_single_variable_feature') |
1267 | | - expect(holdouts.length).to eq(0) |
| 1267 | + expect(holdouts.length).to eq(1) |
1268 | 1268 |
|
1269 | 1269 | global_holdout = holdouts.find { |h| h['key'] == 'global_holdout' } |
1270 | 1270 | expect(global_holdout).to be_nil |
|
1274 | 1274 | holdouts1 = config_with_holdouts.get_holdouts_for_flag('multi_variate_feature') |
1275 | 1275 | holdouts2 = config_with_holdouts.get_holdouts_for_flag('multi_variate_feature') |
1276 | 1276 | expect(holdouts1).to equal(holdouts2) |
1277 | | - expect(holdouts1.length).to eq(2) |
| 1277 | + expect(holdouts1.length).to eq(3) |
1278 | 1278 | end |
1279 | 1279 |
|
1280 | 1280 | it 'should return only global holdouts for flags not specifically targeted' do |
1281 | 1281 | holdouts = config_with_holdouts.get_holdouts_for_flag('string_single_variable_feature') |
1282 | 1282 |
|
1283 | 1283 | # Should only include global holdout (not excluded and no specific targeting) |
1284 | | - expect(holdouts.length).to eq(1) |
| 1284 | + expect(holdouts.length).to eq(2) |
1285 | 1285 | expect(holdouts.first['key']).to eq('global_holdout') |
1286 | 1286 | end |
1287 | 1287 | end |
|
1624 | 1624 | holdout = config_with_holdouts.holdouts.first |
1625 | 1625 |
|
1626 | 1626 | if holdout |
1627 | | - expect(holdout['status']).to eq('Running') |
| 1627 | + expect(holdout['status']).to be_in(['Running', 'Inactive']) |
1628 | 1628 | expect(holdout).to have_key('audiences') |
1629 | 1629 | end |
1630 | 1630 | end |
|
1679 | 1679 |
|
1680 | 1680 | # These holdouts should match all users |
1681 | 1681 | holdouts_with_empty_audiences.each do |holdout| |
1682 | | - expect(holdout['status']).to eq('Running') |
| 1682 | + expect(holdout['status']).to be_in(['Running', 'Inactive']) |
1683 | 1683 | end |
1684 | 1684 | end |
1685 | 1685 | end |
|
0 commit comments