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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fcedf58fc1405166a840214b69cd021061b686c
4
- data.tar.gz: c83cf9a0d47872b3fa5d12fb60f0252ef135f362
3
+ metadata.gz: a0cd117776ed55857fe4b60e6abe35d2ff07f99a
4
+ data.tar.gz: 28d661214a0d3c0f93f5015409b527b42e91a2b6
5
5
  SHA512:
6
- metadata.gz: b097f87b2d6698b79d126a2b8b8e4ef10abb177adca5f1c5d4d38766311210428da56be8186e6431287fc088dcfacecb86936ad310c66013550568d706a07547
7
- data.tar.gz: 4a2ed172d3be58f075b27d2551cdd7b325d0d68aebcf31c8e1bdcd82fe98fdbc9f22ad5444e1abde98d3c8cbbbd0493aaf02bece3130ddf7458d7baaf9ec0361
6
+ metadata.gz: 7a9ceddcd1c71b780e5b6c7a0333ee3162deeb7a51bd547bc9f72655de9ca4d090c68c1a1d2c38926932e0d6f60c5fb251984e9c0edd1bbcbf4187fc4e29d43d
7
+ data.tar.gz: 7189ef298d5fae8d808ac2723a738fa67e1c9594aedf3bae8a5ef04dbb219acf6c7dc92ad7dd13012bb2d70baf80b694f11e83dec079654014afdf3f558c3fdb
@@ -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 deliver_push_notification(platform, recipient, data)
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
@@ -1,3 +1,3 @@
1
1
  module Rumour
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
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 '.send_text_message with valid data' do
34
- it 'creates and retrieves a new message as a hash' do
35
- rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
36
- text_message = rumour_client.send_text_message(TWILIO_TEST_SENDER_NUMBER, TWILIO_TEST_RECIPIENT_NUMBER, 'Hello from rumour-ruby!')
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
- expect(text_message['id']).to_not be_nil
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 '.send_text_message with invalid data' do
43
- it 'raises a RequestError' do
44
- rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
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
- expect {
47
- text_message = rumour_client.send_text_message('+351123456789', '+351123456789', 'Hello from rumour-ruby!')
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.3
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-18 00:00:00.000000000 Z
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.5
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