rumour-ruby 0.0.3 → 0.0.4
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/rumour-ruby/client.rb +2 -2
- data/lib/rumour-ruby/version.rb +1 -1
- data/spec/client_spec.rb +24 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0cd117776ed55857fe4b60e6abe35d2ff07f99a
|
4
|
+
data.tar.gz: 28d661214a0d3c0f93f5015409b527b42e91a2b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a9ceddcd1c71b780e5b6c7a0333ee3162deeb7a51bd547bc9f72655de9ca4d090c68c1a1d2c38926932e0d6f60c5fb251984e9c0edd1bbcbf4187fc4e29d43d
|
7
|
+
data.tar.gz: 7189ef298d5fae8d808ac2723a738fa67e1c9594aedf3bae8a5ef04dbb219acf6c7dc92ad7dd13012bb2d70baf80b694f11e83dec079654014afdf3f558c3fdb
|
data/lib/rumour-ruby/client.rb
CHANGED
@@ -19,8 +19,8 @@ module Rumour
|
|
19
19
|
post('/text_messages', text_message: { from: sender, recipient: recipient, body: body })
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
23
|
-
post('/push_notifications', platform: platform, recipient: recipient, data: data)
|
22
|
+
def send_push_notification(platform, recipient, data)
|
23
|
+
post('/push_notifications', push_notification: { platform: platform, recipient: recipient, data: data })
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
data/lib/rumour-ruby/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -30,22 +30,35 @@ RSpec.describe Rumour::Client do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
describe '
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
describe 'text_messages' do
|
34
|
+
describe 'send with valid data' do
|
35
|
+
it 'creates and retrieves a new message as a hash' do
|
36
|
+
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
37
|
+
text_message = rumour_client.send_text_message(TWILIO_TEST_SENDER_NUMBER, TWILIO_TEST_RECIPIENT_NUMBER, 'Hello from rumour-ruby!')
|
37
38
|
|
38
|
-
|
39
|
+
expect(text_message['id']).to_not be_nil
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'send with invalid data' do
|
44
|
+
it 'raises a RequestError' do
|
45
|
+
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
46
|
+
|
47
|
+
expect {
|
48
|
+
text_message = rumour_client.send_text_message('+351123456789', '+351123456789', 'Hello from rumour-ruby!')
|
49
|
+
}.to raise_error(Rumour::Errors::RequestError)
|
50
|
+
end
|
39
51
|
end
|
40
52
|
end
|
41
53
|
|
42
|
-
describe '
|
43
|
-
|
44
|
-
|
54
|
+
describe 'push_notifications' do
|
55
|
+
describe 'send with valid data' do
|
56
|
+
it 'creates and retrieves a new push notification as a hash' do
|
57
|
+
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
58
|
+
push_notification = rumour_client.send_push_notification('android', 'some_registration_id', { hello: 'world'})
|
45
59
|
|
46
|
-
|
47
|
-
|
48
|
-
}.to raise_error(Rumour::Errors::RequestError)
|
60
|
+
expect(push_notification['id']).to_not be_nil
|
61
|
+
end
|
49
62
|
end
|
50
63
|
end
|
51
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumour-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joao Diogo Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.4.
|
98
|
+
rubygems_version: 2.4.3
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Ruby wrapper for the Rumour REST API
|