|
1281 | 1281 | end |
1282 | 1282 |
|
1283 | 1283 | it 'should return only global holdouts for flags not specifically targeted' do |
1284 | | - string_feature_id = '594060' |
| 1284 | + string_feature_id = '155557' |
1285 | 1285 | holdouts = config_with_holdouts.get_holdouts_for_flag(string_feature_id) |
1286 | 1286 |
|
1287 | 1287 | # Should only include global holdout (not excluded and no specific targeting) |
|
1366 | 1366 | # Use the correct feature flag IDs from the debug output |
1367 | 1367 | boolean_feature_id = '155554' |
1368 | 1368 | multi_variate_feature_id = '155559' |
1369 | | - empty_feature_id = '594032' |
1370 | | - string_feature_id = '594060' |
| 1369 | + empty_feature_id = '155564' |
| 1370 | + string_feature_id = '155557' |
1371 | 1371 |
|
1372 | 1372 | config_body_with_holdouts['holdouts'] = [ |
1373 | 1373 | { |
|
1403 | 1403 | # Use the correct feature flag IDs |
1404 | 1404 | boolean_feature_id = '155554' |
1405 | 1405 | multi_variate_feature_id = '155559' |
1406 | | - empty_feature_id = '594032' |
1407 | | - string_feature_id = '594060' |
| 1406 | + empty_feature_id = '155564' |
| 1407 | + string_feature_id = '155557' |
1408 | 1408 |
|
1409 | 1409 | expect(config_with_complex_holdouts.included_holdouts[multi_variate_feature_id]).not_to be_nil |
1410 | 1410 | expect(config_with_complex_holdouts.included_holdouts[multi_variate_feature_id]).not_to be_empty |
|
1474 | 1474 | feature_flag = config_with_holdouts.feature_flag_key_map['boolean_feature'] |
1475 | 1475 | expect(feature_flag).not_to be_nil |
1476 | 1476 |
|
1477 | | - holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag('boolean_feature') |
| 1477 | + holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag(feature_flag['id']) |
1478 | 1478 | expect(holdouts_for_flag).to be_an(Array) |
1479 | 1479 | end |
1480 | 1480 | end |
|
1485 | 1485 | feature_flag = config_with_holdouts.feature_flag_key_map['boolean_feature'] |
1486 | 1486 |
|
1487 | 1487 | if feature_flag |
1488 | | - holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag('boolean_feature') |
| 1488 | + holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag(feature_flag['id']) |
1489 | 1489 |
|
1490 | 1490 | # Should not include holdouts that exclude this flag |
1491 | 1491 | excluded_holdout = holdouts_for_flag.find { |h| h['key'] == 'excluded_holdout' } |
|
1497 | 1497 | feature_flag = config_with_holdouts.feature_flag_key_map['boolean_feature'] |
1498 | 1498 | expect(feature_flag).not_to be_nil |
1499 | 1499 |
|
1500 | | - holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag('boolean_feature') |
| 1500 | + holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag(feature_flag['id']) |
1501 | 1501 | expect(holdouts_for_flag).to be_an(Array) |
1502 | 1502 | end |
1503 | 1503 | end |
|
1523 | 1523 | end |
1524 | 1524 |
|
1525 | 1525 | it 'should properly cache holdout lookups' do |
1526 | | - holdouts_1 = config_with_holdouts.get_holdouts_for_flag('boolean_feature') |
1527 | | - holdouts_2 = config_with_holdouts.get_holdouts_for_flag('boolean_feature') |
| 1526 | + feature_flag = config_with_holdouts.feature_flag_key_map['boolean_feature'] |
| 1527 | + holdouts_1 = config_with_holdouts.get_holdouts_for_flag(feature_flag['id']) |
| 1528 | + holdouts_2 = config_with_holdouts.get_holdouts_for_flag(feature_flag['id']) |
1528 | 1529 |
|
1529 | 1530 | expect(holdouts_1).to equal(holdouts_2) |
1530 | 1531 | end |
|
1703 | 1704 | feature_flag = config_with_holdouts.feature_flag_key_map['boolean_feature'] |
1704 | 1705 | expect(feature_flag).not_to be_nil |
1705 | 1706 |
|
1706 | | - holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag('boolean_feature') |
| 1707 | + holdouts_for_flag = config_with_holdouts.get_holdouts_for_flag(feature_flag['id']) |
1707 | 1708 |
|
1708 | 1709 | holdouts_for_flag.each do |holdout| |
1709 | 1710 | # Each holdout should have necessary info for decision reasoning |
|
1758 | 1759 | error_handler |
1759 | 1760 | ) |
1760 | 1761 |
|
1761 | | - holdouts_for_flag = config_without_holdouts.get_holdouts_for_flag('boolean_feature') |
| 1762 | + feature_flag = config_without_holdouts.feature_flag_key_map['boolean_feature'] |
| 1763 | + holdouts_for_flag = config_without_holdouts.get_holdouts_for_flag(feature_flag['id']) |
1762 | 1764 | expect(holdouts_for_flag).to eq([]) |
1763 | 1765 | end |
1764 | 1766 |
|
|
0 commit comments