Sha256: becdc12116ce341ee325e0b35272889d7ee4fcb70fa4a82e2794603cf87c2fd4

Contents?: true

Size: 1.15 KB

Versions: 25

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

class Twilio::REST::TaskRouter::StatisticsTestHarnessStatistics
  def initialize(*args)
  end
end

class StatisticsTestHarness
  include Twilio::REST::TaskRouter::Statistics

  def initialize(path, client)
    @path = path
    @client = client
  end
end

describe Twilio::REST::TaskRouter::Statistics do
  it "creates a new statistics object based on the class" do
    client = double("Client")
    allow(client).to receive(:get)
    harness = StatisticsTestHarness.new("/test/harness", client)
    expect(harness.statistics).to(
      be_an_instance_of(Twilio::REST::TaskRouter::StatisticsTestHarnessStatistics)
    )
  end

  it "passes parameters to the HTTP request for statistics" do
    client = Twilio::REST::TaskRouterClient.new 'someSid', 'someAuthToken', 'someWorkspaceSid'
    allow(Net::HTTP::Get).to receive(:new)
      .with("/test/harness/Statistics?Minutes=15", Twilio::REST::BaseClient::HTTP_HEADERS)
      .and_call_original
    harness = StatisticsTestHarness.new("/test/harness", client)
    expect(harness.statistics(minutes: 15)).to(
      be_an_instance_of(Twilio::REST::TaskRouter::StatisticsTestHarnessStatistics)
    )
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
twilio-ruby-4.13.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.12.1 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.11.1 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.11.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.10.0.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.10.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.9.1 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.9.1.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.9.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.9.0.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.8.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.7.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.8.3.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.8.2.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.8.1.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.8.0.edge spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.6.2 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.6.1 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.6.0 spec/rest/task_router/statistics_spec.rb
twilio-ruby-4.7.0.edge spec/rest/task_router/statistics_spec.rb