From fd4eb7db3605af7ab20c7881e35e74a7630a0210 Mon Sep 17 00:00:00 2001 From: Bilal Al Date: Wed, 24 Apr 2024 15:24:04 -0700 Subject: [PATCH] fix specs --- spec/integrations/push_client_spec.rb | 11 ++++++----- spec/splitclient/split_client_spec.rb | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/spec/integrations/push_client_spec.rb b/spec/integrations/push_client_spec.rb index 8673bbd9..721340b2 100644 --- a/spec/integrations/push_client_spec.rb +++ b/spec/integrations/push_client_spec.rb @@ -151,12 +151,9 @@ stub_request(:post, 'https://telemetry.split.io/api/v1/metrics/config').to_return(status: 200, body: '') stub_request(:get, "https://sdk.split.io/api/splitChanges?s=1.1&since=1585948850111").to_return(status: 200, body: '') stub_request(:get, "https://sdk.split.io/api/segmentChanges/bilal_segment?since=-1").to_return(status: 200, body: '') - mock_server do |server| - server.setup_response('/') do |_, res| - send_content(res, event_split_iff_update_no_compression) - end + stub_request(:get, auth_service_url + "?s=1.1").to_return(status: 200, body: auth_body_response) - stub_request(:get, auth_service_url + "?s=1.1").to_return(status: 200, body: auth_body_response) + mock_server do |server| streaming_service_url = server.base_uri factory = SplitIoClient::SplitFactory.new( @@ -168,6 +165,10 @@ client = factory.client client.block_until_ready + server.setup_response('/') do |_, res| + send_content(res, event_split_iff_update_no_compression) + end + treatment = 'control' for i in 1..5 do sleep(1) diff --git a/spec/splitclient/split_client_spec.rb b/spec/splitclient/split_client_spec.rb index d61922cc..55b4447d 100644 --- a/spec/splitclient/split_client_spec.rb +++ b/spec/splitclient/split_client_spec.rb @@ -56,14 +56,14 @@ end it 'posting impressions and events' do - stub_request(:get, 'https://sdk.split.io/api/splitChanges?since=-1') + stub_request(:get, 'https://sdk.split.io/api/splitChanges?s=1.1&since=-1') .to_return(status: 200, body: splits) stub_request(:post, 'https://events.split.io/api/events/bulk').to_return(status: 200, body: '') stub_request(:post, 'https://events.split.io/api/testImpressions/bulk').to_return(status: 200, body: '') stub_request(:post, 'https://telemetry.split.io/api/v1/metrics/config').to_return(status: 200, body: '') stub_request(:post, 'https://telemetry.split.io/api/v1/metrics/usage').to_return(status: 200, body: '') - stub_request(:get, "https://sdk.split.io/api/splitChanges?since=1506703262916").to_return(status: 200, body: 'ok') - stub_request(:get, "https://sdk.split.io/api/splitChanges?sets=set_3&since=1506703262916").to_return(status: 200, body: 'ok') + stub_request(:get, "https://sdk.split.io/api/splitChanges?s=1.1&since=1506703262916").to_return(status: 200, body: 'ok') + stub_request(:get, "https://sdk.split.io/api/splitChanges?s=1.1&since=1506703262916sets=set_3&").to_return(status: 200, body: 'ok') mock_segment_changes('segment1', segment1, '-1') mock_segment_changes('segment1', segment1, '1470947453877') mock_segment_changes('segment2', segment2, '-1') @@ -74,7 +74,7 @@ features_refresh_rate: 9999, streaming_enabled: false) client5 = factory5.client - client5.block_until_ready + client5.block_until_ready(5) for a in 1..100 do expect(client5.track('id' + a.to_s, 'account', 'event', 1)).to be_truthy