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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7674c086c80db7834a92272eebb53c46a34b99ae
4
- data.tar.gz: 1255500d791fff684483ca669daecc551de1fa49
3
+ metadata.gz: e8115db2e8857dc7fb357cd7d3a1918dc432ca2c
4
+ data.tar.gz: 27f4571f0d3b990d01c1b62420ccf838c5393b20
5
5
  SHA512:
6
- metadata.gz: 94331bbdea92775b4d5acf1beb1010e4023fc085d6604610baeae062417b0ea480490fb99ae29bba54ec212019803ae2aff748f4e86698ac1e4b43f238f2e1f8
7
- data.tar.gz: ffadd89f700dec1ee01ef0e17749b99cea5fea0d7bd64e680113f94852e014ff0ee0fbae501aba2050484148db5f94e2144ce6cb6f9c0242cc9b966adc1921f9
6
+ metadata.gz: 7d7e04dc26767471f1e0519cd1f1d246cd2bd5138a1767de8be1a078445321816733f8c19f87ee724768bdbae90130e84ca5b5b0f3bdc5ac8bd30d71ae15ff38
7
+ data.tar.gz: 4194a1bca047a393d75b1ce7874ae171ac1cd85afacffa8928a8a0fec4276a8af520e2fc6104cf96ee2088d1195d4e614da1cf8cce8f64e713d499b15c337115
@@ -18,6 +18,7 @@ require 'telapi/conference'
18
18
  require 'telapi/fraud'
19
19
  require 'telapi/incoming_phone_number'
20
20
  require 'telapi/message'
21
+ require 'telapi/mms'
21
22
  require 'telapi/notification'
22
23
  require 'telapi/participant'
23
24
  require 'telapi/recording'
@@ -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::Message object given its id
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)
@@ -1,3 +1,3 @@
1
1
  module Telapi
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -8,10 +8,34 @@ describe Telapi::Message do
8
8
 
9
9
  it { should be_kind_of(Telapi::Resource) }
10
10
 
11
- describe ".create" do
12
- it "calls api via http post and returns a MMS resource" do
13
- api_should_use(:post)
14
- klass.create('(111) 111-1111', '(999) 999-9999', 'My MMS message', 'https://si0.twimg.com/profile_images/2539396551/4jsroc6lvo800o81iw64.png').should be_a(klass)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Misiowiec