@@ -2420,27 +2420,28 @@ def callback(_args); end
2420
2420
describe 'when the feature flag is enabled for the user' do
2421
2421
describe 'and a variable usage instance is not found' do
2422
2422
it 'should return the default variable value' do
2423
+ Decision = Struct . new ( :experiment , :variation , :source )
2423
2424
variation_to_return = project_config . rollout_id_map [ '166661' ] [ 'experiments' ] [ 0 ] [ 'variations' ] [ 0 ]
2424
- decision_to_return = {
2425
- 'experiment' => nil ,
2426
- 'variation' => variation_to_return
2427
- }
2425
+ decision_to_return = Decision . new ( { 'key' => 'test-exp' } , variation_to_return , 'feature-test' )
2428
2426
allow ( project_instance . decision_service ) . to receive ( :get_variation_for_feature ) . and_return ( decision_to_return )
2429
2427
2430
2428
expect ( project_instance . notification_center ) . to receive ( :send_notifications ) . once . with (
2431
2429
Optimizely ::NotificationCenter ::NOTIFICATION_TYPES [ :DECISION ] ,
2432
2430
'all-feature-variables' , 'test_user' , { } ,
2433
2431
feature_enabled : true ,
2434
2432
feature_key : 'all_variables_feature' ,
2435
- source : 'rollout ' ,
2433
+ source : 'feature-test ' ,
2436
2434
variable_values : {
2437
2435
'json_variable' => { 'val' => 'default json' } ,
2438
2436
'string_variable' => 'default string' ,
2439
2437
'boolean_variable' => false ,
2440
2438
'double_variable' => 1.99 ,
2441
2439
'integer_variable' => 10
2442
2440
} ,
2443
- source_info : { }
2441
+ source_info : {
2442
+ experiment_key : 'test-exp' ,
2443
+ variation_key : '177775'
2444
+ }
2444
2445
)
2445
2446
2446
2447
expect ( project_instance . get_all_feature_variables ( 'all_variables_feature' , user_id , user_attributes ) )
0 commit comments