File tree Expand file tree Collapse file tree
lib/twilio-ruby/rest/task_router Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module TaskRouter
44 module Statistics
55 def statistics ( args = { } )
66 path = "#{ @path } /Statistics"
7- response = @client . get ( path , args , true )
7+ response = @client . get ( path , args )
88 statistics_class . new ( path , @client , response )
99 end
1010
Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ class Twilio ::REST ::TaskRouter ::StatisticsTestHarnessStatistics
4+ def initialize ( *args )
5+ end
6+ end
7+
8+ class StatisticsTestHarness
9+ include Twilio ::REST ::TaskRouter ::Statistics
10+
11+ def initialize ( path , client )
12+ @path = path
13+ @client = client
14+ end
15+ end
16+
17+ describe Twilio ::REST ::TaskRouter ::Statistics do
18+ it "creates a new statistics object based on the class" do
19+ client = double ( "Client" )
20+ allow ( client ) . to receive ( :get )
21+ harness = StatisticsTestHarness . new ( "/test/harness" , client )
22+ expect ( harness . statistics ) . to (
23+ be_an_instance_of ( Twilio ::REST ::TaskRouter ::StatisticsTestHarnessStatistics )
24+ )
25+ end
26+
27+ it "passes parameters to the HTTP request for statistics" do
28+ client = Twilio ::REST ::TaskRouterClient . new 'someSid' , 'someAuthToken' , 'someWorkspaceSid'
29+ allow ( Net ::HTTP ::Get ) . to receive ( :new )
30+ . with ( "/test/harness/Statistics?Minutes=15" , Twilio ::REST ::BaseClient ::HTTP_HEADERS )
31+ . and_call_original
32+ harness = StatisticsTestHarness . new ( "/test/harness" , client )
33+ expect ( harness . statistics ( minutes : 15 ) ) . to (
34+ be_an_instance_of ( Twilio ::REST ::TaskRouter ::StatisticsTestHarnessStatistics )
35+ )
36+ end
37+ end
You can’t perform that action at this time.
0 commit comments