|
829 | 829 | it 'should hit other audience with segments in ab test' do
|
830 | 830 | stub_request(:post, impression_log_url)
|
831 | 831 | stub_request(:post, 'https://api.zaius.com/v3/events').to_return(status: 200)
|
832 |
| - user_context_obj = Optimizely::OptimizelyUserContext.new(integration_project_instance, 'tester', 'age' => 30) |
| 832 | + user_context_obj = Optimizely::OptimizelyUserContext.new(integration_project_instance, 'tester', {'age' => 30}) |
833 | 833 | user_context_obj.qualified_segments = %w[odp-segment-none]
|
834 | 834 |
|
835 | 835 | decision = user_context_obj.decide('flag-segment', [Optimizely::Decide::OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE])
|
|
894 | 894 | integration_project_instance.close
|
895 | 895 | end
|
896 | 896 |
|
| 897 | + it 'should skip identify with decisions' do |
| 898 | + stub_request(:post, impression_log_url) |
| 899 | + expect(integration_project_instance.odp_manager).to receive(:identify_user).with({user_id: 'tester'}) |
| 900 | + expect(spy_logger).not_to receive(:log).with(Logger::ERROR, anything) |
| 901 | + |
| 902 | + user_context = Optimizely::OptimizelyUserContext.new(integration_project_instance, 'tester', {}) |
| 903 | + |
| 904 | + expect(integration_project_instance.odp_manager).not_to receive(:identify_user) |
| 905 | + |
| 906 | + user_context.decide('flag-segment') |
| 907 | + user_context.decide_all |
| 908 | + user_context.decide_for_keys(['flag-segment']) |
| 909 | + |
| 910 | + integration_project_instance.close |
| 911 | + end |
| 912 | + |
897 | 913 | describe '#fetch_qualified_segments' do
|
898 | 914 | it 'should fetch segments' do
|
899 | 915 | stub_request(:post, 'https://api.zaius.com/v3/graphql').to_return(status: 200, body: good_response_data.to_json)
|
|
0 commit comments