spec/integration/taskrouter/v1/workspace/workflow_spec.rb in twilio-ruby-5.0.0.rc18 vs spec/integration/taskrouter/v1/workspace/workflow_spec.rb in twilio-ruby-5.0.0.rc19

- old
+ new

@@ -1,27 +1,27 @@ ## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 -# / / +# / / require 'spec_helper.rb' describe 'Workflow' do it "can fetch" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) - + expect { @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ - .workflows("WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() + .workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() }.to raise_exception(Twilio::REST::TwilioException) - + values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', - url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives fetch responses" do @holodeck.mock(Twilio::TwilioResponse.new( @@ -37,34 +37,37 @@ "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics" + } } ] )) - + actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ - .workflows("WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() - + .workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() + expect(actual).to_not eq(nil) end it "can update" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) - + expect { @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ - .workflows("WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() + .workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() }.to raise_exception(Twilio::REST::TwilioException) - + values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'post', - url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives update responses" do @holodeck.mock(Twilio::TwilioResponse.new( @@ -80,57 +83,60 @@ "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics" + }, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] )) - + actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ - .workflows("WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() - + .workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() + expect(actual).to_not eq(nil) end it "can delete" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) - + expect { @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ - .workflows("WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() + .workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() }.to raise_exception(Twilio::REST::TwilioException) - + values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'delete', - url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives delete responses" do @holodeck.mock(Twilio::TwilioResponse.new( 204, nil, )) - + actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ - .workflows("WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() - + .workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() + expect(actual).to eq(true) end it "can read" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) - + expect { @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .workflows.list() }.to raise_exception(Twilio::REST::TwilioException) - + values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows', @@ -163,20 +169,23 @@ "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics" + }, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ] )) - + actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .workflows.list() - + expect(actual).to_not eq(nil) end it "receives read_empty responses" do @holodeck.mock(Twilio::TwilioResponse.new( @@ -195,25 +204,25 @@ }, "workflows": [] } ] )) - + actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .workflows.list() - + expect(actual).to_not eq(nil) end it "can create" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) - + expect { @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .workflows.create(friendly_name: "friendly_name", configuration: "configuration") }.to raise_exception(Twilio::REST::TwilioException) - + values = { 'FriendlyName' => "friendly_name", 'Configuration' => "configuration", } expect( @@ -224,11 +233,11 @@ ))).to eq(true) end it "receives create responses" do @holodeck.mock(Twilio::TwilioResponse.new( - 200, + 201, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_callback_url": "http://example.com", "configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n", @@ -238,16 +247,19 @@ "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics" + } } ] )) - + actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .workflows.create(friendly_name: "friendly_name", configuration: "configuration") - + expect(actual).to_not eq(nil) end end \ No newline at end of file