Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilal Al committed Apr 24, 2024
1 parent 796014b commit fd4eb7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions spec/integrations/push_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions spec/splitclient/split_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down

0 comments on commit fd4eb7d

Please sign in to comment.