## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / require 'spec_helper.rb' describe 'TaskQueueRealTimeStatistics' do it "can fetch" do @holodeck.mock(Twilio::Response.new(500, '')) expect { @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .task_queues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .real_time_statistics().fetch() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics', ))).to eq(true) end it "receives fetch responses" do @holodeck.mock(Twilio::Response.new( 200, %q[ { "longest_task_waiting_age": 100, "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tasks_by_status": { "reserved": 0, "pending": 0, "assigned": 0, "wrapping": 0 }, "total_eligible_workers": 100, "activity_statistics": [ { "friendly_name": "Idle", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Busy", "workers": 9, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Offline", "workers": 6, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Reserved", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "tasks_by_priority": {}, "total_tasks": 100, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "total_available_workers": 100, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics" } ] )) actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .task_queues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .real_time_statistics().fetch() expect(actual).to_not eq(nil) end end