signalwire 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +55 -0
- data/.rubocop.yml +14 -2
- data/AUTHORS.md +1 -0
- data/CHANGELOG.md +30 -5
- data/Gemfile +4 -18
- data/LICENSE +21 -0
- data/README.md +22 -82
- data/Rakefile +0 -17
- data/examples/relay/inbound_consumer.rb +26 -0
- data/examples/relay/inbound_dial.rb +28 -0
- data/examples/relay/outbound_collect.rb +27 -0
- data/examples/relay/outbound_consumer.rb +22 -0
- data/examples/relay/outbound_record.rb +25 -0
- data/lib/signalwire.rb +13 -0
- data/lib/signalwire/blade.rb +12 -0
- data/lib/signalwire/blade/connection.rb +200 -0
- data/lib/signalwire/blade/event_handler.rb +15 -0
- data/lib/signalwire/blade/message.rb +38 -0
- data/lib/signalwire/blade/message/connect.rb +18 -0
- data/lib/signalwire/blade/message/execute.rb +16 -0
- data/lib/signalwire/blade/message/subscribe.rb +15 -0
- data/lib/signalwire/common.rb +6 -0
- data/lib/signalwire/logger.rb +27 -0
- data/lib/signalwire/relay.rb +40 -0
- data/lib/signalwire/relay/calling.rb +82 -0
- data/lib/signalwire/relay/calling/action.rb +16 -0
- data/lib/signalwire/relay/calling/action/connect_action.rb +11 -0
- data/lib/signalwire/relay/calling/action/play_action.rb +15 -0
- data/lib/signalwire/relay/calling/action/prompt_action.rb +15 -0
- data/lib/signalwire/relay/calling/action/record_action.rb +15 -0
- data/lib/signalwire/relay/calling/call.rb +210 -0
- data/lib/signalwire/relay/calling/call_convenience_methods.rb +79 -0
- data/lib/signalwire/relay/calling/component.rb +115 -0
- data/lib/signalwire/relay/calling/component/answer.rb +27 -0
- data/lib/signalwire/relay/calling/component/await.rb +20 -0
- data/lib/signalwire/relay/calling/component/connect.rb +45 -0
- data/lib/signalwire/relay/calling/component/dial.rb +34 -0
- data/lib/signalwire/relay/calling/component/hangup.rb +41 -0
- data/lib/signalwire/relay/calling/component/play.rb +46 -0
- data/lib/signalwire/relay/calling/component/prompt.rb +62 -0
- data/lib/signalwire/relay/calling/component/record.rb +53 -0
- data/lib/signalwire/relay/calling/control_component.rb +35 -0
- data/lib/signalwire/relay/calling/result.rb +16 -0
- data/lib/signalwire/relay/calling/result/answer_result.rb +6 -0
- data/lib/signalwire/relay/calling/result/connect_result.rb +9 -0
- data/lib/signalwire/relay/calling/result/dial_result.rb +7 -0
- data/lib/signalwire/relay/calling/result/hangup_result.rb +7 -0
- data/lib/signalwire/relay/calling/result/play_result.rb +6 -0
- data/lib/signalwire/relay/calling/result/prompt_result.rb +11 -0
- data/lib/signalwire/relay/calling/result/record_result.rb +7 -0
- data/lib/signalwire/relay/client.rb +147 -0
- data/lib/signalwire/relay/constants.rb +109 -0
- data/lib/signalwire/relay/consumer.rb +88 -0
- data/lib/signalwire/relay/event.rb +41 -0
- data/lib/signalwire/relay/request.rb +6 -0
- data/lib/signalwire/rest/client.rb +5 -5
- data/lib/signalwire/sdk/fax_response.rb +3 -3
- data/lib/signalwire/sdk/messaging_response.rb +0 -2
- data/lib/signalwire/sdk/twilio_set_fax.rb +9 -8
- data/lib/signalwire/sdk/twilio_set_host.rb +8 -3
- data/lib/signalwire/version.rb +5 -0
- data/signalwire.gemspec +36 -106
- metadata +173 -76
- data/LICENSE.txt +0 -20
- data/VERSION +0 -1
- data/spec/signalwire/rest/client_spec.rb +0 -30
- data/spec/signalwire/rest/integration_spec.rb +0 -102
- data/spec/signalwire/sdk/configuration_spec.rb +0 -28
- data/spec/signalwire/sdk/fax_response_spec.rb +0 -26
- data/spec/signalwire/sdk/messaging_response_spec.rb +0 -18
- data/spec/signalwire/sdk/voice_response_spec.rb +0 -20
- data/spec/signalwire/sdk_spec.rb +0 -27
- data/spec/spec_helper.rb +0 -119
- data/spec/vcr_cassettes/accounts.yml +0 -27
- data/spec/vcr_cassettes/applications.yml +0 -29
- data/spec/vcr_cassettes/get_fax.yml +0 -25
- data/spec/vcr_cassettes/get_fax_media_instance.yml +0 -27
- data/spec/vcr_cassettes/get_fax_media_list.yml +0 -47
- data/spec/vcr_cassettes/list_faxes.yml +0 -25
- data/spec/vcr_cassettes/local_numbers.yml +0 -26
- data/spec/vcr_cassettes/recordings.yml +0 -27
- data/spec/vcr_cassettes/send_fax.yml +0 -27
- data/spec/vcr_cassettes/toll_free_numbers.yml +0 -34
- data/spec/vcr_cassettes/transcriptions.yml +0 -28
data/LICENSE.txt
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2018 Luca Pradovera
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.4.0
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
module Signalwire
|
|
6
|
-
RSpec.describe REST::Client do
|
|
7
|
-
it 'makes the correct request' do
|
|
8
|
-
Signalwire::Sdk.configure do |config|
|
|
9
|
-
config.hostname = 'myswspace.signalwire.com'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
@client = Signalwire::REST::Client.new 'MYSWPROJECT',
|
|
13
|
-
'MYSWTOKEN'
|
|
14
|
-
|
|
15
|
-
stub = stub_request(:post, 'https://myswspace.signalwire.com/api/laml/2010-04-01/Accounts/MYSWPROJECT/Messages.json')
|
|
16
|
-
.with(body: { 'Body' => 'This is a message from the Signalwire-Ruby library!',
|
|
17
|
-
'From' => '+15556677999', 'To' => '+15558866555' })
|
|
18
|
-
|
|
19
|
-
@message = @client.messages.create(
|
|
20
|
-
from: '+15556677999',
|
|
21
|
-
to: '+15558866555',
|
|
22
|
-
body: 'This is a message from the Signalwire-Ruby library!'
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
expect(stub).to have_been_requested
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
RSpec.describe Signalwire::REST::Client do
|
|
6
|
-
before :all do
|
|
7
|
-
Signalwire::Sdk.configure do |config|
|
|
8
|
-
config.hostname = ENV.fetch('SIGNALWIRE_SPACE', 'testing.signalwire.com')
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
before :each do
|
|
13
|
-
@client = Signalwire::REST::Client.new ENV.fetch('SIGNALWIRE_ACCOUNT', 'xyz123-xyz123-xyz123'),
|
|
14
|
-
ENV.fetch('SIGNALWIRE_TOKEN', 'PTxyz123-xyz123-xyz123')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "fetches accounts" do
|
|
18
|
-
VCR.use_cassette("accounts") do
|
|
19
|
-
accounts = @client.api.accounts.list
|
|
20
|
-
expect(accounts.first.friendly_name).to eq 'LAML testing'
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'fetches applications' do
|
|
25
|
-
VCR.use_cassette('applications') do
|
|
26
|
-
applications = @client.applications.list
|
|
27
|
-
expect(applications.first.sid).to eq '34f49a97-a863-4a11-8fef-bc399c6f0928'
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'fetches local numbers' do
|
|
32
|
-
VCR.use_cassette('local_numbers') do
|
|
33
|
-
numbers = @client.api.available_phone_numbers('US').local.list(in_region: 'WA')
|
|
34
|
-
expect(numbers.first.phone_number).to eq '+12062011680'
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it 'fetches toll free numbers' do
|
|
39
|
-
VCR.use_cassette('toll_free_numbers') do
|
|
40
|
-
numbers = @client.api.available_phone_numbers('US').toll_free.list(area_code: '310')
|
|
41
|
-
expect(numbers.first.phone_number).to eq '+13102174822'
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
it 'fetches recordings' do
|
|
46
|
-
VCR.use_cassette('recordings') do
|
|
47
|
-
recordings = @client.recordings.list
|
|
48
|
-
expect(recordings.first.call_sid).to eq 'd411976d-d319-4fbd-923c-57c62b6f677a'
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it 'fetches transcriptions' do
|
|
53
|
-
VCR.use_cassette('transcriptions') do
|
|
54
|
-
recordings = @client.transcriptions.list
|
|
55
|
-
expect(recordings.first.recording_sid).to eq 'e4c78e17-c0e2-441d-b5dd-39a6dad496f8'
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
context 'faxes' do
|
|
60
|
-
it 'sends a fax' do
|
|
61
|
-
VCR.use_cassette('send_fax') do
|
|
62
|
-
fax = @client.fax.faxes
|
|
63
|
-
.create(
|
|
64
|
-
from: '+15556677888',
|
|
65
|
-
to: '+15556677999',
|
|
66
|
-
media_url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'
|
|
67
|
-
)
|
|
68
|
-
expect(fax.sid).to eq '831455c6-574e-4d8b-b6ee-2418140bf4cd'
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
it 'lists faxes' do
|
|
73
|
-
VCR.use_cassette('list_faxes') do
|
|
74
|
-
faxes = @client.fax.faxes.list
|
|
75
|
-
expect(faxes.first.sid).to eq '831455c6-574e-4d8b-b6ee-2418140bf4cd'
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
it 'gets a fax' do
|
|
80
|
-
VCR.use_cassette('get_fax') do
|
|
81
|
-
fax = @client.fax.faxes('831455c6-574e-4d8b-b6ee-2418140bf4cd').fetch
|
|
82
|
-
expect(fax.to).to eq '+15556677999'
|
|
83
|
-
expect(fax.media_url).to eq 'https://s3.us-east-2.amazonaws.com/signalwire-assets/faxes/20190104162834-831455c6-574e-4d8b-b6ee-2418140bf4cd.tiff'
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
it 'gets a faxes media' do
|
|
88
|
-
VCR.use_cassette('get_fax_media_list') do
|
|
89
|
-
fax = @client.fax.faxes('831455c6-574e-4d8b-b6ee-2418140bf4cd').fetch
|
|
90
|
-
expect(fax.media.list.first.sid).to eq 'aff0684c-3445-49bc-802b-3a0a488139f5'
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'gets a media instance' do
|
|
95
|
-
VCR.use_cassette('get_fax_media_instance') do
|
|
96
|
-
fax_media = @client.fax.faxes('831455c6-574e-4d8b-b6ee-2418140bf4cd').media('aff0684c-3445-49bc-802b-3a0a488139f5').fetch
|
|
97
|
-
expect(fax_media.content_type).to eq 'image/tiff'
|
|
98
|
-
expect(fax_media.url).to eq '/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Faxes/831455c6-574e-4d8b-b6ee-2418140bf4cd/Media/aff0684c-3445-49bc-802b-3a0a488139f5.json'
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
module Signalwire
|
|
6
|
-
RSpec.describe Sdk::Configuration do
|
|
7
|
-
describe '#hostname' do
|
|
8
|
-
it 'there is no default' do
|
|
9
|
-
expect(Sdk::Configuration.new.hostname).to eq nil
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
describe '#hostname=' do
|
|
14
|
-
it 'can set value' do
|
|
15
|
-
config = Sdk::Configuration.new
|
|
16
|
-
config.hostname = 'test.signalwire.com'
|
|
17
|
-
expect(config.hostname).to eq('test.signalwire.com')
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
describe 'setting up directly in the constructor' do
|
|
22
|
-
it 'sets the configuration in the constructor' do
|
|
23
|
-
client = Signalwire::REST::Client.new 'xyz123-xyz123-xyz123', 'PTxyz123-xyz123-xyz123', signalwire_space_url: 'test.signalwire.com'
|
|
24
|
-
expect(Signalwire::Sdk.configuration.hostname).to eq('test.signalwire.com')
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
module Signalwire
|
|
6
|
-
RSpec.describe Sdk::FaxResponse do
|
|
7
|
-
it 'generates the correct LAML' do
|
|
8
|
-
response = Signalwire::Sdk::FaxResponse.new do |r|
|
|
9
|
-
r.receive(action: '/receive/fax')
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
expect(response.to_s).to eq "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n"\
|
|
13
|
-
"<Receive action=\"/receive/fax\"/>\n</Response>\n"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it 'can reject a fax' do
|
|
17
|
-
response = Signalwire::Sdk::FaxResponse.new do |r|
|
|
18
|
-
r.reject
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
expect(response.to_s).to eq "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n"\
|
|
22
|
-
"<Reject/>\n</Response>\n"
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
module Signalwire
|
|
6
|
-
RSpec.describe Sdk::MessagingResponse do
|
|
7
|
-
it 'generates the correct LAML' do
|
|
8
|
-
response = Signalwire::Sdk::MessagingResponse.new do |r|
|
|
9
|
-
r.message body: 'hello from a SignalWire SMS'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
expect(response.to_s).to eq "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n"\
|
|
13
|
-
"<Message>hello from a SignalWire SMS</Message>\n</Response>\n"
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
module Signalwire
|
|
6
|
-
RSpec.describe Sdk::VoiceResponse do
|
|
7
|
-
it 'generates the correct LAML' do
|
|
8
|
-
response = Signalwire::Sdk::VoiceResponse.new do |r|
|
|
9
|
-
r.say(message: 'hello there', voice: 'alice')
|
|
10
|
-
r.dial(caller_id: '+14159992222') do |d|
|
|
11
|
-
d.number('+15552233444')
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
expect(response.to_s).to eq "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response>\n"\
|
|
16
|
-
"<Say voice=\"alice\">hello there</Say>\n<Dial callerId=\"+14159992222\">\n"\
|
|
17
|
-
"<Number>+15552233444</Number>\n</Dial>\n</Response>\n"
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
data/spec/signalwire/sdk_spec.rb
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
|
|
5
|
-
RSpec.describe Signalwire::Sdk do
|
|
6
|
-
describe '#configure' do
|
|
7
|
-
it 'returns the configured hostname' do
|
|
8
|
-
Signalwire::Sdk.configure do |config|
|
|
9
|
-
config.hostname = 'demo.signalwire.com'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
twilio_client = Twilio::REST::Client.new
|
|
13
|
-
expect(twilio_client.api.hostname).to eq('demo.signalwire.com')
|
|
14
|
-
expect(twilio_client.fax.hostname).to eq('demo.signalwire.com')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'requires the hostname configuration to be set' do
|
|
18
|
-
Signalwire::Sdk.configure do |config|
|
|
19
|
-
config.hostname = nil
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
expect do
|
|
23
|
-
Twilio::REST::Client.new.api
|
|
24
|
-
end.to raise_exception ArgumentError, /SignalWire Space URL is not configured/
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'simplecov'
|
|
4
|
-
SimpleCov.start
|
|
5
|
-
|
|
6
|
-
%w[
|
|
7
|
-
bundler/setup
|
|
8
|
-
signalwire/sdk
|
|
9
|
-
webmock/rspec
|
|
10
|
-
vcr
|
|
11
|
-
].each { |f| require f }
|
|
12
|
-
|
|
13
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
|
14
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
15
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
16
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
|
17
|
-
# files.
|
|
18
|
-
#
|
|
19
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
|
20
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
21
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
22
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
|
23
|
-
# a separate helper file that requires the additional dependencies and performs
|
|
24
|
-
# the additional setup, and require it from the spec files that actually need
|
|
25
|
-
# it.
|
|
26
|
-
#
|
|
27
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
28
|
-
# users commonly want.
|
|
29
|
-
#
|
|
30
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
31
|
-
RSpec.configure do |config|
|
|
32
|
-
# rspec-expectations config goes here. You can use an alternate
|
|
33
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
34
|
-
# assertions if you prefer.
|
|
35
|
-
config.expect_with :rspec do |expectations|
|
|
36
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
37
|
-
# and `failure_message` of custom matchers include text for helper methods
|
|
38
|
-
# defined using `chain`, e.g.:
|
|
39
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
|
40
|
-
# # => "be bigger than 2 and smaller than 4"
|
|
41
|
-
# ...rather than:
|
|
42
|
-
# # => "be bigger than 2"
|
|
43
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
|
47
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
48
|
-
config.mock_with :rspec do |mocks|
|
|
49
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
|
50
|
-
# a real object. This is generally recommended, and will default to
|
|
51
|
-
# `true` in RSpec 4.
|
|
52
|
-
mocks.verify_partial_doubles = true
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
|
56
|
-
# have no way to turn it off -- the option exists only for backwards
|
|
57
|
-
# compatibility in RSpec 3). It causes shared context metadata to be
|
|
58
|
-
# inherited by the metadata hash of host groups and examples, rather than
|
|
59
|
-
# triggering implicit auto-inclusion in groups with matching metadata.
|
|
60
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
|
61
|
-
|
|
62
|
-
# The settings below are suggested to provide a good initial experience
|
|
63
|
-
# with RSpec, but feel free to customize to your heart's content.
|
|
64
|
-
# # This allows you to limit a spec run to individual examples or groups
|
|
65
|
-
# # you care about by tagging them with `:focus` metadata. When nothing
|
|
66
|
-
# # is tagged with `:focus`, all examples get run. RSpec also provides
|
|
67
|
-
# # aliases for `it`, `describe`, and `context` that include `:focus`
|
|
68
|
-
# # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
|
69
|
-
# config.filter_run_when_matching :focus
|
|
70
|
-
#
|
|
71
|
-
# # Allows RSpec to persist some state between runs in order to support
|
|
72
|
-
# # the `--only-failures` and `--next-failure` CLI options. We recommend
|
|
73
|
-
# # you configure your source control system to ignore this file.
|
|
74
|
-
# config.example_status_persistence_file_path = "spec/examples.txt"
|
|
75
|
-
#
|
|
76
|
-
# # Limits the available syntax to the non-monkey patched syntax that is
|
|
77
|
-
# # recommended. For more details, see:
|
|
78
|
-
# # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
|
79
|
-
# # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
80
|
-
# # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
|
81
|
-
# config.disable_monkey_patching!
|
|
82
|
-
#
|
|
83
|
-
# # This setting enables warnings. It's recommended, but in some cases may
|
|
84
|
-
# # be too noisy due to issues in dependencies.
|
|
85
|
-
# config.warnings = true
|
|
86
|
-
#
|
|
87
|
-
# # Many RSpec users commonly either run the entire suite or an individual
|
|
88
|
-
# # file, and it's useful to allow more verbose output when running an
|
|
89
|
-
# # individual spec file.
|
|
90
|
-
# if config.files_to_run.one?
|
|
91
|
-
# # Use the documentation formatter for detailed output,
|
|
92
|
-
# # unless a formatter has already been configured
|
|
93
|
-
# # (e.g. via a command-line flag).
|
|
94
|
-
# config.default_formatter = 'doc'
|
|
95
|
-
# end
|
|
96
|
-
#
|
|
97
|
-
# # Print the 10 slowest examples and example groups at the
|
|
98
|
-
# # end of the spec run, to help surface which specs are running
|
|
99
|
-
# # particularly slow.
|
|
100
|
-
# config.profile_examples = 10
|
|
101
|
-
#
|
|
102
|
-
# # Run specs in random order to surface order dependencies. If you find an
|
|
103
|
-
# # order dependency and want to debug it, you can fix the order by providing
|
|
104
|
-
# # the seed, which is printed after each run.
|
|
105
|
-
# # --seed 1234
|
|
106
|
-
# config.order = :random
|
|
107
|
-
#
|
|
108
|
-
# # Seed global randomization in this process using the `--seed` CLI option.
|
|
109
|
-
# # Setting this allows you to use `--seed` to deterministically reproduce
|
|
110
|
-
# # test failures related to randomization by passing the same `--seed` value
|
|
111
|
-
# # as the one that triggered the failure.
|
|
112
|
-
# Kernel.srand config.seed
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
VCR.configure do |config|
|
|
116
|
-
config.hook_into :webmock
|
|
117
|
-
config.cassette_library_dir = 'spec/vcr_cassettes'
|
|
118
|
-
#config.allow_http_connections_when_no_cassette = true
|
|
119
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: get
|
|
5
|
-
uri: https://testing.signalwire.com/api/laml/2010-04-01/Accounts.json
|
|
6
|
-
body:
|
|
7
|
-
encoding: US-ASCII
|
|
8
|
-
string: ''
|
|
9
|
-
headers:
|
|
10
|
-
Accept-Charset:
|
|
11
|
-
- utf-8
|
|
12
|
-
Accept:
|
|
13
|
-
- application/json
|
|
14
|
-
Accept-Encoding:
|
|
15
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
16
|
-
response:
|
|
17
|
-
status:
|
|
18
|
-
code: 200
|
|
19
|
-
message: OK
|
|
20
|
-
body:
|
|
21
|
-
encoding: UTF-8
|
|
22
|
-
string: '{"uri":"/api/laml/2010-04-01/Accounts?Page=1\u0026PageSize=50","start":0,"end":0,"first_page_uri":"/api/laml/2010-04-01/Accounts?Page=1\u0026PageSize=50","next_page_uri":null,"previous_page_uri":null,"page":0,"page_size":50,"accounts":[{"sid":"xyz123-xyz123-xyz123","friendly_name":"LAML
|
|
23
|
-
testing","status":"active","auth_token":"redacted","date_created":"Mon, 20
|
|
24
|
-
Aug 2018 12:54:10 +0000","date_updated":"Mon, 20 Aug 2018 12:54:10 +0000","type":"Full","uri":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123","subresource_uris":{"addresses":null,"available_phone_numbers":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/AvailablePhoneNumbers","applications":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Applications","authorized_connect_apps":null,"calls":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Calls","conferences":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Conferences","connect_apps":null,"incoming_phone_numbers":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/IncomingPhoneNumbers","keys":null,"notifications":null,"outgoing_caller_ids":null,"queues":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Queues","recordings":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Recordings","sandbox":null,"signing_keys":null,"sip":null,"short_codes":null,"messages":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Messages","transcriptions":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Transcriptions","usage":null}}]}'
|
|
25
|
-
http_version:
|
|
26
|
-
recorded_at: Wed, 26 Dec 2018 16:47:17 GMT
|
|
27
|
-
recorded_with: VCR 4.0.0
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: get
|
|
5
|
-
uri: https://testing.signalwire.com/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Applications.json
|
|
6
|
-
body:
|
|
7
|
-
encoding: US-ASCII
|
|
8
|
-
string: ''
|
|
9
|
-
headers:
|
|
10
|
-
User-Agent:
|
|
11
|
-
- twilio-ruby/5.18.0 (ruby/x86_64-darwin17 2.5.0-p0)
|
|
12
|
-
Accept-Charset:
|
|
13
|
-
- utf-8
|
|
14
|
-
Accept:
|
|
15
|
-
- application/json
|
|
16
|
-
Accept-Encoding:
|
|
17
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
18
|
-
response:
|
|
19
|
-
status:
|
|
20
|
-
code: 200
|
|
21
|
-
message: OK
|
|
22
|
-
body:
|
|
23
|
-
encoding: UTF-8
|
|
24
|
-
string: '{"uri":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Applications?Page=0\u0026PageSize=50","first_page_uri":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Applications?Page=0\u0026PageSize=50","next_page_uri":null,"previous_page_uri":null,"page":0,"page_size":50,"applications":[{"sid":"34f49a97-a863-4a11-8fef-bc399c6f0928","date_created":"Wed,
|
|
25
|
-
19 Dec 2018 14:23:36 +0000","date_updated":"Wed, 19 Dec 2018 15:45:52 +0000","account_sid":"xyz123-xyz123-xyz123","friendly_name":"Test
|
|
26
|
-
App","voice_url":"https://testing.signalwire.com/laml-bins/edfb6a6e-a60a-4a56-9a9c-04babd511882","voice_method":"GET","voice_fallback_url":"","voice_fallback_method":"POST","status_callback":"","status_callback_method":"POST","voice_caller_id_lookup":null,"sms_url":"","sms_method":"POST","sms_fallback_url":"","sms_fallback_method":"POST","sms_status_callback":"","sms_status_callback_method":"POST","api_version":"2010-04-01","uri":"/api/laml/2010-04-01/Accounts/xyz123-xyz123-xyz123/Calls/34f49a97-a863-4a11-8fef-bc399c6f0928"}]}'
|
|
27
|
-
http_version:
|
|
28
|
-
recorded_at: Wed, 26 Dec 2018 16:51:53 GMT
|
|
29
|
-
recorded_with: VCR 4.0.0
|