|
1035 | 1035 | end |
1036 | 1036 | end |
1037 | 1037 |
|
1038 | | - describe 'exclude_targeted_deliveries holdout behavior' do |
| 1038 | + describe 'excludeTargetedDeliveries holdout behavior' do |
1039 | 1039 | let(:config_with_holdouts) do |
1040 | 1040 | Optimizely::DatafileProjectConfig.new( |
1041 | 1041 | OptimizelySpec::CONFIG_BODY_WITH_HOLDOUTS_JSON, |
|
1058 | 1058 |
|
1059 | 1059 | after(:example) { project_with_holdouts&.close } |
1060 | 1060 |
|
1061 | | - describe 'global holdout with exclude_targeted_deliveries' do |
1062 | | - it 'applies holdout normally when exclude_targeted_deliveries is false' do |
| 1061 | + describe 'global holdout with excludeTargetedDeliveries' do |
| 1062 | + it 'applies holdout normally when excludeTargetedDeliveries is false' do |
1063 | 1063 | global_holdout = config_with_holdouts.get_holdout('holdout_1') |
1064 | | - global_holdout['exclude_targeted_deliveries'] = false |
| 1064 | + global_holdout['excludeTargetedDeliveries'] = false |
1065 | 1065 |
|
1066 | 1066 | allow(ds).to receive(:get_variation_for_holdout) |
1067 | 1067 | .with(global_holdout, anything, anything) |
|
1125 | 1125 | end |
1126 | 1126 | end |
1127 | 1127 |
|
1128 | | - describe 'global holdout with missing exclude_targeted_deliveries (backward compat)' do |
| 1128 | + describe 'global holdout with missing excludeTargetedDeliveries (backward compat)' do |
1129 | 1129 | it 'defaults to applying holdout normally when field is absent' do |
1130 | 1130 | global_holdout = config_with_holdouts.get_holdout('holdout_1') |
1131 | | - global_holdout.delete('exclude_targeted_deliveries') |
| 1131 | + global_holdout.delete('excludeTargetedDeliveries') |
1132 | 1132 |
|
1133 | 1133 | allow(ds).to receive(:get_variation_for_holdout) |
1134 | 1134 | .with(global_holdout, anything, anything) |
|
1162 | 1162 | end |
1163 | 1163 | end |
1164 | 1164 |
|
1165 | | - describe 'local holdout with exclude_targeted_deliveries' do |
1166 | | - it 'local holdout still applies even when exclude_targeted_deliveries is true' do |
| 1165 | + describe 'local holdout with excludeTargetedDeliveries' do |
| 1166 | + it 'local holdout still applies even when excludeTargetedDeliveries is true' do |
1167 | 1167 | local_holdout = config_with_holdouts.get_holdout('holdout_local_1') |
1168 | | - local_holdout['exclude_targeted_deliveries'] = true |
| 1168 | + local_holdout['excludeTargetedDeliveries'] = true |
1169 | 1169 |
|
1170 | 1170 | experiment = config_with_holdouts.experiment_id_map['122227'] |
1171 | 1171 |
|
|
1203 | 1203 | user_profile_tracker |
1204 | 1204 | ) |
1205 | 1205 |
|
1206 | | - # Local holdout MUST still apply — exclude_targeted_deliveries is ignored for local holdouts |
| 1206 | + # Local holdout MUST still apply — excludeTargetedDeliveries is ignored for local holdouts |
1207 | 1207 | expect(result.holdout_decision).not_to be_nil |
1208 | 1208 | expect(result.holdout_decision.source).to eq(Optimizely::DecisionService::DECISION_SOURCES['HOLDOUT']) |
1209 | 1209 | expect(result.variation_id).to eq(local_holdout['variations'].first['id']) |
1210 | 1210 | end |
1211 | 1211 |
|
1212 | | - it 'applies local holdout for all rules even when exclude_targeted_deliveries is true' do |
| 1212 | + it 'applies local holdout for all rules even when excludeTargetedDeliveries is true' do |
1213 | 1213 | local_holdout = config_with_holdouts.get_holdout('holdout_local_1') |
1214 | | - local_holdout['exclude_targeted_deliveries'] = true |
| 1214 | + local_holdout['excludeTargetedDeliveries'] = true |
1215 | 1215 |
|
1216 | 1216 | experiment = config_with_holdouts.experiment_id_map['122227'] |
1217 | 1217 |
|
|
1254 | 1254 | expect(result.holdout_decision.source).to eq(Optimizely::DecisionService::DECISION_SOURCES['HOLDOUT']) |
1255 | 1255 | end |
1256 | 1256 |
|
1257 | | - it 'applies local holdout normally when exclude_targeted_deliveries is false' do |
| 1257 | + it 'applies local holdout normally when excludeTargetedDeliveries is false' do |
1258 | 1258 | local_holdout = config_with_holdouts.get_holdout('holdout_local_1') |
1259 | | - local_holdout['exclude_targeted_deliveries'] = false |
| 1259 | + local_holdout['excludeTargetedDeliveries'] = false |
1260 | 1260 |
|
1261 | 1261 | experiment = config_with_holdouts.experiment_id_map['122227'] |
1262 | 1262 |
|
|
1267 | 1267 | .and_return(Optimizely::DecisionService::DecisionResult.new(nil, false, [])) |
1268 | 1268 | end |
1269 | 1269 |
|
1270 | | - # Local holdout fires even for TD rule because exclude_targeted_deliveries is false |
| 1270 | + # Local holdout fires even for TD rule because excludeTargetedDeliveries is false |
1271 | 1271 | allow(ds).to receive(:get_variation_for_holdout) |
1272 | 1272 | .with(local_holdout, anything, anything) |
1273 | 1273 | .and_return( |
|
1294 | 1294 | user_profile_tracker |
1295 | 1295 | ) |
1296 | 1296 |
|
1297 | | - # Holdout applies to TD rule because exclude_targeted_deliveries is false |
| 1297 | + # Holdout applies to TD rule because excludeTargetedDeliveries is false |
1298 | 1298 | expect(result.holdout_decision).not_to be_nil |
1299 | 1299 | expect(result.holdout_decision.source).to eq(Optimizely::DecisionService::DECISION_SOURCES['HOLDOUT']) |
1300 | 1300 | end |
1301 | 1301 | end |
1302 | 1302 |
|
1303 | | - describe 'global holdout exclude_targeted_deliveries integration with get_decision_for_flag' do |
1304 | | - it 'skips experiments and returns rollout decision with holdout_decision attached when exclude_targeted_deliveries=true' do |
| 1303 | + describe 'global holdout excludeTargetedDeliveries integration with get_decision_for_flag' do |
| 1304 | + it 'skips experiments and returns rollout decision with holdout_decision attached when excludeTargetedDeliveries=true' do |
1305 | 1305 | global_holdout = config_with_holdouts.get_holdout('holdout_1') |
1306 | | - global_holdout['exclude_targeted_deliveries'] = true |
| 1306 | + global_holdout['excludeTargetedDeliveries'] = true |
1307 | 1307 |
|
1308 | 1308 | holdout_variation = global_holdout['variations'].first |
1309 | 1309 | holdout_dec = Optimizely::DecisionService::Decision.new( |
|
1339 | 1339 | expect(result.holdout_decision.source).to eq(Optimizely::DecisionService::DECISION_SOURCES['HOLDOUT']) |
1340 | 1340 | end |
1341 | 1341 |
|
1342 | | - it 'returns nil decision with holdout_decision attached when exclude_targeted_deliveries=true and TD returns nil' do |
| 1342 | + it 'returns nil decision with holdout_decision attached when excludeTargetedDeliveries=true and TD returns nil' do |
1343 | 1343 | global_holdout = config_with_holdouts.get_holdout('holdout_1') |
1344 | | - global_holdout['exclude_targeted_deliveries'] = true |
| 1344 | + global_holdout['excludeTargetedDeliveries'] = true |
1345 | 1345 |
|
1346 | 1346 | holdout_variation = global_holdout['variations'].first |
1347 | 1347 | holdout_dec = Optimizely::DecisionService::Decision.new( |
|
1384 | 1384 | end |
1385 | 1385 | end |
1386 | 1386 |
|
1387 | | - describe 'forced decision beats holdout with exclude_targeted_deliveries' do |
1388 | | - it 'returns forced decision even when exclude_targeted_deliveries is true and holdout covers the rule' do |
| 1387 | + describe 'forced decision beats holdout with excludeTargetedDeliveries' do |
| 1388 | + it 'returns forced decision even when excludeTargetedDeliveries is true and holdout covers the rule' do |
1389 | 1389 | local_holdout = config_with_holdouts.get_holdout('holdout_local_1') |
1390 | | - local_holdout['exclude_targeted_deliveries'] = true |
| 1390 | + local_holdout['excludeTargetedDeliveries'] = true |
1391 | 1391 | expect(local_holdout['trafficAllocation'].first['endOfRange']).to eq(10_000) |
1392 | 1392 |
|
1393 | 1393 | experiment = config_with_holdouts.experiment_id_map['122227'] |
|
0 commit comments