outbox-twilio 0.3.0 → 0.3.1
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/lib/outbox/twilio/client.rb +2 -2
- data/lib/outbox/twilio/version.rb +1 -1
- data/spec/outbox/twilio/client_spec.rb +3 -7
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2fbc6f6de9ebc59001d2f2e72c8978ad8f51fe03
|
|
4
|
+
data.tar.gz: 3e6f1dd42430109404f0f3cbb784a9fb3c5a8070
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e4a7b9abf243637256fc92970791d213fa0ab6c58dc176e413505f8cd140775416360ac80511d532f1d501128a753f09beb89fec01d05f9d3cfef6ebe9c7400
|
|
7
|
+
data.tar.gz: 81f51a3e23304b2b53ba954a61ba700b4f7fb953bd12c831ee648e28c7aabc6d94fe0add2831da3cc2a604f1a4e7fd7fb04c868b4c400b98ece6a4bc80910ed5
|
data/lib/outbox/twilio/client.rb
CHANGED
|
@@ -25,7 +25,7 @@ module Outbox
|
|
|
25
25
|
@api_client = ::Twilio::REST::Client.new(
|
|
26
26
|
options[:username] || options[:account_sid],
|
|
27
27
|
options[:password] || options[:auth_token],
|
|
28
|
-
options[:account_sid]
|
|
28
|
+
options[:account_sid]
|
|
29
29
|
)
|
|
30
30
|
end
|
|
31
31
|
|
|
@@ -39,7 +39,7 @@ module Outbox
|
|
|
39
39
|
application_sid: sms[:application_sid]
|
|
40
40
|
}
|
|
41
41
|
params.delete_if { |_, value| value.nil? }
|
|
42
|
-
@api_client.account.messages.create(params)
|
|
42
|
+
@api_client.account.messages.create(params)
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -7,8 +7,7 @@ describe Outbox::Twilio::Client do
|
|
|
7
7
|
expect(::Twilio::REST::Client).to receive(:new).with(
|
|
8
8
|
'AC1',
|
|
9
9
|
'abcdef',
|
|
10
|
-
'AC1'
|
|
11
|
-
nil
|
|
10
|
+
'AC1'
|
|
12
11
|
).and_return(api_client)
|
|
13
12
|
client = Outbox::Twilio::Client.new(
|
|
14
13
|
account_sid: 'AC1',
|
|
@@ -23,8 +22,7 @@ describe Outbox::Twilio::Client do
|
|
|
23
22
|
expect(::Twilio::REST::Client).to receive(:new).with(
|
|
24
23
|
'username',
|
|
25
24
|
'abcdef',
|
|
26
|
-
'AC1'
|
|
27
|
-
nil
|
|
25
|
+
'AC1'
|
|
28
26
|
).and_return(api_client)
|
|
29
27
|
client = Outbox::Twilio::Client.new(
|
|
30
28
|
username: 'username',
|
|
@@ -53,8 +51,6 @@ describe Outbox::Twilio::Client do
|
|
|
53
51
|
end
|
|
54
52
|
|
|
55
53
|
it 'delivers the SMS' do
|
|
56
|
-
message_context = double(:message_context)
|
|
57
|
-
expect(message_context).to receive(:fetch)
|
|
58
54
|
expect(@client.api_client.account.messages).to receive(:create).with(
|
|
59
55
|
to: '+14155551212',
|
|
60
56
|
from: 'Company Name',
|
|
@@ -62,7 +58,7 @@ describe Outbox::Twilio::Client do
|
|
|
62
58
|
media_url: 'http://www.example.com/hearts.png',
|
|
63
59
|
status_callback: 'http://www.example.com/callback',
|
|
64
60
|
application_sid: '1234'
|
|
65
|
-
).and_return(message_context)
|
|
61
|
+
).and_return(double(:message_context))
|
|
66
62
|
@client.deliver(@sms)
|
|
67
63
|
end
|
|
68
64
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: outbox-twilio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pete Browne
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-02-
|
|
11
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: outbox
|