telapi 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/telapi.rb +1 -0
- data/lib/telapi/mms.rb +2 -2
- data/lib/telapi/version.rb +1 -1
- data/spec/telapi/mms_spec.rb +28 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8115db2e8857dc7fb357cd7d3a1918dc432ca2c
|
4
|
+
data.tar.gz: 27f4571f0d3b990d01c1b62420ccf838c5393b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d7e04dc26767471f1e0519cd1f1d246cd2bd5138a1767de8be1a078445321816733f8c19f87ee724768bdbae90130e84ca5b5b0f3bdc5ac8bd30d71ae15ff38
|
7
|
+
data.tar.gz: 4194a1bca047a393d75b1ce7874ae171ac1cd85afacffa8928a8a0fec4276a8af520e2fc6104cf96ee2088d1195d4e614da1cf8cce8f64e713d499b15c337115
|
data/lib/telapi.rb
CHANGED
data/lib/telapi/mms.rb
CHANGED
@@ -16,8 +16,8 @@ module Telapi
|
|
16
16
|
response = Network.get(['MMS', 'Messages'], optional_params)
|
17
17
|
ResourceCollection.new(response, 'mms_messages', self)
|
18
18
|
end
|
19
|
-
|
20
|
-
# Returns a specific Telapi::
|
19
|
+
|
20
|
+
# Returns a specific Telapi::MMS object given its id
|
21
21
|
def get(id)
|
22
22
|
response = Network.get(['MMS', 'Messages', id])
|
23
23
|
Message.new(response)
|
data/lib/telapi/version.rb
CHANGED
data/spec/telapi/mms_spec.rb
CHANGED
@@ -8,10 +8,34 @@ describe Telapi::Message do
|
|
8
8
|
|
9
9
|
it { should be_kind_of(Telapi::Resource) }
|
10
10
|
|
11
|
-
describe ".
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
describe ".list" do
|
12
|
+
before { stub_telapi_request('{ "mms_messages": [] }') }
|
13
|
+
|
14
|
+
it "calls api via http get and returns a ResourceCollection" do
|
15
|
+
api_should_use(:get)
|
16
|
+
klass.list.should be_a(Telapi::ResourceCollection)
|
17
|
+
end
|
18
|
+
|
19
|
+
context "when MMS exist" do
|
20
|
+
before { stub_telapi_request('{ "mms_messages": [{ "to": "+14245551234","from": "+17325551234"}] }') }
|
21
|
+
|
22
|
+
it "has a collection of MMS objects" do
|
23
|
+
klass.list.first.should be_a(klass)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe ".get" do
|
29
|
+
it "calls api via http get and returns an MMS resource" do
|
30
|
+
api_should_use(:get)
|
31
|
+
klass.get('abc123').should be_a(klass)
|
15
32
|
end
|
16
33
|
end
|
34
|
+
|
35
|
+
describe ".create" do
|
36
|
+
it "calls api via http post and returns a MMS resource" do
|
37
|
+
api_should_use(:post)
|
38
|
+
klass.create('(111) 111-1111', '(999) 999-9999', 'My MMS message', 'https://si0.twimg.com/profile_images/2539396551/4jsroc6lvo800o81iw64.png').should be_a(klass)
|
39
|
+
end
|
40
|
+
end
|
17
41
|
end
|