esendex 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/esendex/application_controller.rb +0 -0
  3. data/app/controllers/esendex/inbound_messages_controller.rb +0 -0
  4. data/app/controllers/esendex/message_delivered_events_controller.rb +0 -0
  5. data/app/controllers/esendex/message_failed_events_controller.rb +0 -0
  6. data/app/controllers/esendex/push_notification_handler.rb +0 -0
  7. data/config/routes.rb +0 -0
  8. data/lib/esendex.rb +0 -0
  9. data/lib/esendex/account.rb +0 -0
  10. data/lib/esendex/api_connection.rb +0 -0
  11. data/lib/esendex/dispatcher_result.rb +0 -0
  12. data/lib/esendex/engine.rb +0 -0
  13. data/lib/esendex/exceptions.rb +0 -0
  14. data/lib/esendex/hash_serialisation.rb +0 -0
  15. data/lib/esendex/inbound_message.rb +0 -0
  16. data/lib/esendex/message.rb +0 -0
  17. data/lib/esendex/message_batch_submission.rb +0 -0
  18. data/lib/esendex/message_delivered_event.rb +0 -0
  19. data/lib/esendex/message_failed_event.rb +0 -0
  20. data/lib/esendex/railtie.rb +0 -0
  21. data/lib/esendex/version.rb +1 -1
  22. data/lib/esendex/voice_message.rb +0 -0
  23. data/lib/tasks/esendex.rake +0 -0
  24. data/licence.txt +0 -0
  25. data/readme.md +5 -5
  26. data/spec/account_spec.rb +32 -32
  27. data/spec/api_connection_spec.rb +10 -10
  28. data/spec/controllers/message_delivered_events_controller_spec.rb +0 -0
  29. data/spec/controllers/push_notification_handler_spec.rb +9 -9
  30. data/spec/dummy/README.rdoc +0 -0
  31. data/spec/dummy/Rakefile +0 -0
  32. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  33. data/spec/dummy/app/assets/stylesheets/application.css +0 -0
  34. data/spec/dummy/app/controllers/application_controller.rb +0 -0
  35. data/spec/dummy/app/helpers/application_helper.rb +0 -0
  36. data/spec/dummy/app/views/layouts/application.html.erb +0 -0
  37. data/spec/dummy/config.ru +0 -0
  38. data/spec/dummy/config/application.rb +0 -0
  39. data/spec/dummy/config/boot.rb +0 -0
  40. data/spec/dummy/config/environment.rb +0 -0
  41. data/spec/dummy/config/environments/development.rb +2 -3
  42. data/spec/dummy/config/environments/production.rb +2 -0
  43. data/spec/dummy/config/environments/test.rb +1 -2
  44. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -0
  45. data/spec/dummy/config/initializers/inflections.rb +0 -0
  46. data/spec/dummy/config/initializers/mime_types.rb +0 -0
  47. data/spec/dummy/config/initializers/secret_token.rb +0 -0
  48. data/spec/dummy/config/initializers/session_store.rb +0 -0
  49. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -0
  50. data/spec/dummy/config/locales/en.yml +0 -0
  51. data/spec/dummy/config/routes.rb +0 -0
  52. data/spec/dummy/log/test.log +0 -0
  53. data/spec/dummy/public/404.html +0 -0
  54. data/spec/dummy/public/422.html +0 -0
  55. data/spec/dummy/public/500.html +0 -0
  56. data/spec/dummy/public/favicon.ico +0 -0
  57. data/spec/dummy/script/rails +0 -0
  58. data/spec/hash_serialisation_spec.rb +4 -4
  59. data/spec/inbound_message_spec.rb +6 -6
  60. data/spec/message_batch_submission_spec.rb +4 -4
  61. data/spec/message_delivered_event_spec.rb +4 -4
  62. data/spec/message_failed_event_spec.rb +4 -4
  63. data/spec/message_spec.rb +6 -6
  64. data/spec/spec_helper.rb +1 -0
  65. data/spec/voice_message_spec.rb +4 -4
  66. metadata +17 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac1d98a5009c85639396fc251b7f1fe73c709321
4
- data.tar.gz: 1a38f74ae0ef3da6fc6f98549b9dc5512f7b57d6
3
+ metadata.gz: 6776e13698bd0f6945a8a47636a60ffc6f15e340
4
+ data.tar.gz: e1693289ee33e889708f5015a445b600f054e31d
5
5
  SHA512:
6
- metadata.gz: 375d165b04e43b38e7607d7a077395c3070f99603797249fee0432da43eb48dcedcbc982b3c11c63a195824afa2e6e37e644b8948c05ed2c2d65800352bbee5d
7
- data.tar.gz: 70e8d44120d20d906dea4e2102b8024254f2ad1ce530a5bdaefe13b768293cf415e8054b62f86533c80a8f43089d01c2f139f6ea36af83fa90dd519149a01716
6
+ metadata.gz: 50bb0e389cd685bf85b53908a109e325a8a3203d47fd0bf251223107e21a00cfc51a4e9fb822f86875e3f864f7d2ca554f6e8cf06f6bcfafbd2a4134f069d7a9
7
+ data.tar.gz: 9b46c9d79326387584c555191794d9529060781c1a73579d1c5285c0d448226749d6cdc9330781be36badbc36f92a5703ff949d1dabf6989aa3b5afbab685a14
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Esendex
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
File without changes
File without changes
File without changes
data/readme.md CHANGED
@@ -96,9 +96,9 @@ Classes are provided in the gem for deserialising the notifications: `MessageDel
96
96
  message = InboundMessage.from_xml request.body
97
97
  ```
98
98
 
99
- ### Rails 3 / Rails 4
99
+ ### Rails 4
100
100
 
101
- In order to simplify receipt of push notifications for Rails 3 users, the gem ships with mountable Rails controllers to handle the receipt of these notifications.
101
+ In order to simplify receipt of push notifications for Rails users, the gem ships with mountable Rails controllers to handle the receipt of these notifications.
102
102
 
103
103
  To mount the end points, add this to `routes.rb`
104
104
 
@@ -117,7 +117,7 @@ Esendex.message_delivered_event_handler = lambda { |notification|
117
117
  }
118
118
  ```
119
119
 
120
- Please be kind to us and don't perform anything potentially long running in this call back as our notifier may timeout the request and pass the notififation to the retry queue.
120
+ Please be kind to us and don't perform anything potentially long running in this call back as our notifier may timeout the request and pass the notification to the retry queue.
121
121
 
122
122
  If you need to perform processing that may run for a longer time then using an async task system like [Resque](https://github.com/defunkt/resque) is recommended.
123
123
 
@@ -176,11 +176,11 @@ This project also ships with a `Guardfile` so you can run tests continuously.
176
176
 
177
177
  ## Contributing
178
178
 
179
- We really welcome any thoughts or guidance on how this gem could best provide the hooks you need to consume our services in your applicaiton. Please fork and raise pull requests for any features you would like us to add or raise an [issue]((https://github.com/esendex/esendex.gem/issues)
179
+ We really welcome any thoughts or guidance on how this gem could best provide the hooks you need to consume our services in your applicaiton. Please fork and raise pull requests for any features you would like us to add or raise an [issue]((https://github.com/esendex/esendex-ruby-sdk/issues)
180
180
 
181
181
  Customers with more pressing issues should contact our support teams via the usual local phone number or by email: [support@esendex.com](mailto:support@esendex.com).
182
182
 
183
183
  ## Copyright
184
184
 
185
- Copyright (c) 2011-13 Esendex Ltd. See licence.txt for further details.
185
+ Copyright (c) 2011-18 Esendex Ltd. See licence.txt for further details.
186
186
 
@@ -31,22 +31,22 @@ describe Account do
31
31
  </account>
32
32
  </accounts>"
33
33
  }
34
- let(:api_connection) { mock("Connection", :get => mock('Response', :body => account_xml), :post => true )}
34
+ let(:api_connection) { double("Connection", :get => double('Response', :body => account_xml), :post => true )}
35
35
 
36
36
  before(:each) do
37
- account.stub(:api_connection) { api_connection }
37
+ allow(account).to receive(:api_connection) { api_connection }
38
38
  end
39
39
 
40
40
  describe "#messages_remaining" do
41
41
  subject { account.messages_remaining }
42
42
 
43
43
  it "should get the account resource" do
44
- api_connection.should_receive(:get).with("/v1.0/accounts")
44
+ expect(api_connection).to receive(:get).with("/v1.0/accounts")
45
45
  subject
46
46
  end
47
47
 
48
48
  it "should get the messages remaining from the document" do
49
- subject.should eq(messages_remaining)
49
+ expect(subject).to eq(messages_remaining)
50
50
  end
51
51
 
52
52
  context "with invalid reference" do
@@ -70,26 +70,26 @@ describe Account do
70
70
  }
71
71
 
72
72
  before(:each) do
73
- api_connection.stub(:post) { mock('Response', :body => send_response_xml) }
73
+ allow(api_connection).to receive(:post) { double('Response', :body => send_response_xml) }
74
74
  end
75
75
 
76
76
  subject { account.send_message(to: "447815777555", body: "Hello from the Esendex Ruby Gem") }
77
77
 
78
78
  it "should post to the message dispatcher resource" do
79
- api_connection.should_receive(:post).with("/v1.0/messagedispatcher", anything)
79
+ expect(api_connection).to receive(:post).with("/v1.0/messagedispatcher", anything)
80
80
  subject
81
81
  end
82
82
 
83
83
  it "should return the batch_id when treated as string" do
84
- subject.to_s.should eq(batch_id)
84
+ expect(subject.to_s).to eq(batch_id)
85
85
  end
86
86
 
87
87
  it "should return the batch_id in the result" do
88
- subject.batch_id.should eq(batch_id)
88
+ expect(subject.batch_id).to eq(batch_id)
89
89
  end
90
90
 
91
91
  it "should provide a list of messages with a single message" do
92
- subject.messages.should have(1).items
92
+ expect(subject.messages).to have(1).items
93
93
  end
94
94
  end
95
95
 
@@ -107,45 +107,45 @@ describe Account do
107
107
  }
108
108
 
109
109
  before(:each) do
110
- api_connection.stub(:post) { mock('Response', :body => send_response_xml) }
110
+ allow(api_connection).to receive(:post) { double('Response', :body => send_response_xml) }
111
111
  end
112
112
 
113
113
  subject { account.send_message(to: "447815777555", body: "Hello from the Esendex Ruby Gem") }
114
114
 
115
115
  it "should post to the message dispatcher resource" do
116
- api_connection.should_receive(:post).with("/v1.0/messagedispatcher", anything)
116
+ expect(api_connection).to receive(:post).with("/v1.0/messagedispatcher", anything)
117
117
  subject
118
118
  end
119
119
 
120
120
  it "should provide a list containing two messages" do
121
- subject.messages.should have(2).items
121
+ expect(subject.messages).to have(2).items
122
122
  end
123
123
 
124
124
  it "should have message one in the message list" do
125
- subject.messages.should include(id: "#{message_one_id}", uri: "#{uri_prefix}#{message_one_id}")
125
+ expect(subject.messages).to include(id: "#{message_one_id}", uri: "#{uri_prefix}#{message_one_id}")
126
126
  end
127
127
 
128
128
  it "should have message two in the message list" do
129
- subject.messages.should include(id: "#{message_two_id}", uri: "#{uri_prefix}#{message_two_id}")
129
+ expect(subject.messages).to include(id: "#{message_two_id}", uri: "#{uri_prefix}#{message_two_id}")
130
130
  end
131
131
  end
132
132
 
133
133
  describe "#sent_messages" do
134
- let(:sent_message_client) { stub("sent_message_client") }
134
+ let(:sent_message_client) { double("sent_message_client") }
135
135
  let(:sent_messages_result) { Class.new }
136
136
 
137
137
  before(:each) do
138
138
  stub_const("Esendex::SentMessageClient", sent_message_client)
139
- sent_message_client
140
- .should_receive(:new)
139
+ expect(sent_message_client)
140
+ .to receive(:new)
141
141
  .with(api_connection)
142
142
  .and_return(sent_message_client)
143
143
  end
144
144
 
145
145
  context "with no args" do
146
146
  before(:each) do
147
- sent_message_client
148
- .should_receive(:get_messages)
147
+ expect(sent_message_client)
148
+ .to receive(:get_messages)
149
149
  .with({account_reference: account_reference})
150
150
  .and_return(sent_messages_result)
151
151
  end
@@ -153,7 +153,7 @@ describe Account do
153
153
  subject { account.sent_messages() }
154
154
 
155
155
  it "should return expected result" do
156
- subject.should eq(sent_messages_result)
156
+ expect(subject).to eq(sent_messages_result)
157
157
  end
158
158
  end
159
159
 
@@ -161,24 +161,24 @@ describe Account do
161
161
  it "should pass dates without adjustment" do
162
162
  start_date = DateTime.now - 30
163
163
  finish_date = DateTime.now - 15
164
- sent_message_client
165
- .should_receive(:get_messages)
164
+ expect(sent_message_client)
165
+ .to receive(:get_messages)
166
166
  .with({account_reference: account_reference, start: start_date, finish: finish_date})
167
167
  .and_return(sent_messages_result)
168
168
 
169
- account.sent_messages({start: start_date, finish: finish_date}).should_not be_nil
169
+ expect(account.sent_messages({start: start_date, finish: finish_date})).to_not be_nil
170
170
  end
171
171
  end
172
172
 
173
173
  context "with start date" do
174
174
  it "should specify start date and default finish date" do
175
175
  start_date = DateTime.now - 1
176
- sent_message_client
177
- .should_receive(:get_messages)
176
+ expect(sent_message_client)
177
+ .to receive(:get_messages)
178
178
  .with({account_reference: account_reference, start: start_date})
179
179
  .and_return(sent_messages_result)
180
180
 
181
- account.sent_messages({start: start_date}).should_not be_nil
181
+ expect(account.sent_messages({start: start_date})).to_not be_nil
182
182
  end
183
183
  end
184
184
 
@@ -186,12 +186,12 @@ describe Account do
186
186
  it "should specify default start date and finish date" do
187
187
  finish_date = DateTime.now - 1
188
188
  start_date = finish_date - 90
189
- sent_message_client
190
- .should_receive(:get_messages)
189
+ expect(sent_message_client)
190
+ .to receive(:get_messages)
191
191
  .with({account_reference: account_reference, finish: finish_date})
192
192
  .and_return(sent_messages_result)
193
193
 
194
- account.sent_messages({finish: finish_date}).should_not be_nil
194
+ expect(account.sent_messages({finish: finish_date})).to_not be_nil
195
195
  end
196
196
  end
197
197
 
@@ -199,12 +199,12 @@ describe Account do
199
199
  it "should pass expected arguments" do
200
200
  start_index = 3
201
201
  count = 35
202
- sent_message_client
203
- .should_receive(:get_messages)
202
+ expect(sent_message_client)
203
+ .to receive(:get_messages)
204
204
  .with({account_reference: account_reference, start_index: start_index, count: count})
205
205
  .and_return(sent_messages_result)
206
206
 
207
- account.sent_messages({start_index: start_index, count: count}).should_not be_nil
207
+ expect(account.sent_messages({start_index: start_index, count: count})).to_not be_nil
208
208
  end
209
209
  end
210
210
  end
@@ -5,9 +5,9 @@ describe ApiConnection do
5
5
 
6
6
  before(:each) do
7
7
  @connection = Nestful::Connection.new Esendex::API_HOST
8
- Nestful::Connection.stub(:new) { @connection }
9
- @connection.stub(:get) {}
10
- @connection.stub(:post) {}
8
+ allow(Nestful::Connection).to receive(:new) { @connection }
9
+ allow(@connection).to receive(:get) {}
10
+ allow(@connection).to receive(:post) {}
11
11
  Esendex.configure do |config|
12
12
  config.username = random_string
13
13
  config.password = random_string
@@ -19,17 +19,17 @@ describe ApiConnection do
19
19
 
20
20
  it "should set the username" do
21
21
  subject
22
- @connection.user.should eq(Esendex.username)
22
+ expect(@connection.user).to eq(Esendex.username)
23
23
  end
24
24
 
25
25
  it "should set the password" do
26
26
  subject
27
- @connection.password.should eq(Esendex.password)
27
+ expect(@connection.password).to eq(Esendex.password)
28
28
  end
29
29
 
30
30
  it "should set the auth to basic" do
31
31
  subject
32
- @connection.auth_type.should eq(:basic)
32
+ expect(@connection.auth_type).to eq(:basic)
33
33
  end
34
34
  end
35
35
 
@@ -40,13 +40,13 @@ describe ApiConnection do
40
40
  subject { api_connection.get url }
41
41
 
42
42
  it "should call get with headers" do
43
- @connection.should_receive(:get).with(url, api_connection.default_headers)
43
+ expect(@connection).to receive(:get).with(url, api_connection.default_headers)
44
44
  subject
45
45
  end
46
46
 
47
47
  context "when 403 raised" do
48
48
  before(:each) do
49
- @connection.stub(:get) { raise Nestful::ForbiddenAccess.new(nil) }
49
+ allow(@connection).to receive(:get) { raise Nestful::ForbiddenAccess.new(nil) }
50
50
  end
51
51
 
52
52
  it "raises an ForbiddenError" do
@@ -62,13 +62,13 @@ describe ApiConnection do
62
62
  subject { api_connection.post url, body }
63
63
 
64
64
  it "should call post with headers" do
65
- @connection.should_receive(:post).with(url, body, api_connection.default_headers)
65
+ expect(@connection).to receive(:post).with(url, body, api_connection.default_headers)
66
66
  subject
67
67
  end
68
68
 
69
69
  context "when 403 raised" do
70
70
  before(:each) do
71
- @connection.stub(:post) { raise Nestful::ForbiddenAccess.new(nil) }
71
+ allow(@connection).to receive(:post) { raise Nestful::ForbiddenAccess.new(nil) }
72
72
  end
73
73
 
74
74
  it "raises an ForbiddenError" do
@@ -11,9 +11,9 @@ module Esendex
11
11
  subject { controller.process_notification @type, @source }
12
12
 
13
13
  before(:each) do
14
- @logger = mock('Logger', info: true)
15
- controller.stub(:logger) { @logger }
16
- controller.stub(:render)
14
+ @logger = double('Logger', info: true)
15
+ allow(controller).to receive(:logger) { @logger }
16
+ allow(controller).to receive(:render)
17
17
  end
18
18
 
19
19
  @notifications = {
@@ -58,7 +58,7 @@ module Esendex
58
58
  @source = config[:source]
59
59
  @notification_class = config[:class]
60
60
  @notification = @notification_class.from_xml(@source)
61
- @notification_class.stub(:from_xml) { @notification }
61
+ allow(@notification_class).to receive(:from_xml) { @notification }
62
62
  end
63
63
 
64
64
  context "when a handler is configured" do
@@ -66,16 +66,16 @@ module Esendex
66
66
  Esendex.send("#{notification_type}_handler=", @handler)
67
67
  end
68
68
  it "initializes a #{config[:class].name} from the source" do
69
- @notification_class.should_receive(:from_xml).with(@source)
69
+ expect(@notification_class).to receive(:from_xml).with(@source)
70
70
  subject
71
71
  end
72
72
  it "calls the handler" do
73
- @handler.should_receive(:call).with(@notification)
73
+ expect(@handler).to receive(:call).with(@notification)
74
74
  subject
75
75
  end
76
76
  it "the handler can process the input" do
77
77
  subject
78
- @received_id.should eq(@notification.id)
78
+ expect(@received_id).to eq(@notification.id)
79
79
  end
80
80
  end
81
81
  context "when no handler configured" do
@@ -83,11 +83,11 @@ module Esendex
83
83
  Esendex.send("#{notification_type}_handler=", nil)
84
84
  end
85
85
  it "does not init a #{config[:class].name}" do
86
- @notification_class.should_not_receive(:from_xml)
86
+ expect(@notification_class).to_not receive(:from_xml)
87
87
  subject
88
88
  end
89
89
  it "should log info line" do
90
- @logger.should_receive(:info).with(/#{notification_type.to_s}/)
90
+ expect(@logger).to receive(:info).with(/#{notification_type.to_s}/)
91
91
  subject
92
92
  end
93
93
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -6,13 +6,12 @@ Dummy::Application.configure do
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
9
  # Show full error reports and disable caching
13
10
  config.consider_all_requests_local = true
14
11
  config.action_controller.perform_caching = false
15
12
 
13
+ config.eager_load = false
14
+
16
15
  # Don't care if the mailer can't send
17
16
  # config.action_mailer.raise_delivery_errors = false
18
17
 
@@ -8,6 +8,8 @@ Dummy::Application.configure do
8
8
  config.consider_all_requests_local = false
9
9
  config.action_controller.perform_caching = true
10
10
 
11
+ config.eager_load = true
12
+
11
13
  # Disable Rails's static asset server (Apache or nginx will already do this)
12
14
  # config.serve_static_assets = false
13
15
 
@@ -11,8 +11,7 @@ Dummy::Application.configure do
11
11
  # config.serve_static_assets = true
12
12
  # config.static_cache_control = "public, max-age=3600"
13
13
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
14
+ config.eager_load = false
16
15
 
17
16
  # Show full error reports and disable caching
18
17
  config.consider_all_requests_local = true
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -22,13 +22,13 @@ module Esendex
22
22
  subject { DummyHashSerialisation.new @attrs }
23
23
 
24
24
  it "sets the name" do
25
- subject.name.should eq(name)
25
+ expect(subject.name).to eq(name)
26
26
  end
27
27
  it "sets the time" do
28
- subject.time.should eq(time)
28
+ expect(subject.time).to eq(time)
29
29
  end
30
30
  it "sets the notes" do
31
- subject.notes.should eq(notes)
31
+ expect(subject.notes).to eq(notes)
32
32
  end
33
33
 
34
34
  context "when invalid attribute passed" do
@@ -45,7 +45,7 @@ module Esendex
45
45
  subject { DummyHashSerialisation.new(@attrs).to_hash }
46
46
 
47
47
  it "should match the init hash" do
48
- subject.should eq(@attrs)
48
+ expect(subject).to eq(@attrs)
49
49
  end
50
50
  end
51
51
 
@@ -22,22 +22,22 @@ describe InboundMessage do
22
22
  subject { InboundMessage.from_xml source }
23
23
 
24
24
  it "should set the id" do
25
- subject.id.should eq(id)
25
+ expect(subject.id).to eq(id)
26
26
  end
27
27
  it "should set the message_id" do
28
- subject.message_id.should eq(message_id)
28
+ expect(subject.message_id).to eq(message_id)
29
29
  end
30
30
  it "should set the account_id" do
31
- subject.account_id.should eq(account_id)
31
+ expect(subject.account_id).to eq(account_id)
32
32
  end
33
33
  it "should set the message_text" do
34
- subject.message_text.should eq(message_text)
34
+ expect(subject.message_text).to eq(message_text)
35
35
  end
36
36
  it "should set the from" do
37
- subject.from.should eq(from)
37
+ expect(subject.from).to eq(from)
38
38
  end
39
39
  it "should set the to" do
40
- subject.to.should eq(to)
40
+ expect(subject.to).to eq(to)
41
41
  end
42
42
  end
43
43
  end
@@ -10,18 +10,18 @@ describe MessageBatchSubmission do
10
10
  subject { message_batch.xml_node }
11
11
 
12
12
  it "creates message nodes" do
13
- subject.xpath('//messages/message').count.should eq(messages.count)
13
+ expect(subject.xpath('//messages/message').count).to eq(messages.count)
14
14
  end
15
15
 
16
16
  it "sets the message to" do
17
17
  (0..1).each do |i|
18
- subject.xpath('//messages/message/to')[i].content.should eq(messages[i].to)
18
+ expect(subject.xpath('//messages/message/to')[i].content).to eq(messages[i].to)
19
19
  end
20
20
  end
21
21
 
22
22
  it "sets the message body" do
23
23
  (0..1).each do |i|
24
- subject.xpath('//messages/message/body')[i].content.should eq(messages[i].body)
24
+ expect(subject.xpath('//messages/message/body')[i].content).to eq(messages[i].body)
25
25
  end
26
26
  end
27
27
 
@@ -33,7 +33,7 @@ describe MessageBatchSubmission do
33
33
  end
34
34
 
35
35
  it "creates a properly formatted sendat node" do
36
- subject.at_xpath('//messages/sendat').content.should eq("2011-04-07T15:00:00")
36
+ expect(subject.at_xpath('//messages/sendat').content).to eq("2011-04-07T15:00:00")
37
37
  end
38
38
  end
39
39
  end
@@ -18,16 +18,16 @@ describe MessageDeliveredEvent do
18
18
  subject { MessageDeliveredEvent.from_xml source }
19
19
 
20
20
  it "should set the id" do
21
- subject.id.should eq(id)
21
+ expect(subject.id).to eq(id)
22
22
  end
23
23
  it "should set the message_id" do
24
- subject.message_id.should eq(message_id)
24
+ expect(subject.message_id).to eq(message_id)
25
25
  end
26
26
  it "should set the account_id" do
27
- subject.account_id.should eq(account_id)
27
+ expect(subject.account_id).to eq(account_id)
28
28
  end
29
29
  it "should set the occurred_at" do
30
- subject.occurred_at.to_i.should eq(occurred_at.to_i)
30
+ expect(subject.occurred_at.to_i).to eq(occurred_at.to_i)
31
31
  end
32
32
  end
33
33
  end
@@ -18,16 +18,16 @@ describe MessageFailedEvent do
18
18
  subject { MessageFailedEvent.from_xml source }
19
19
 
20
20
  it "should set the id" do
21
- subject.id.should eq(id)
21
+ expect(subject.id).to eq(id)
22
22
  end
23
23
  it "should set the message_id" do
24
- subject.message_id.should eq(message_id)
24
+ expect(subject.message_id).to eq(message_id)
25
25
  end
26
26
  it "should set the account_id" do
27
- subject.account_id.should eq(account_id)
27
+ expect(subject.account_id).to eq(account_id)
28
28
  end
29
29
  it "should set the occurred_at" do
30
- subject.occurred_at.to_i.should eq(occurred_at.to_i)
30
+ expect(subject.occurred_at.to_i).to eq(occurred_at.to_i)
31
31
  end
32
32
  end
33
33
  end
@@ -8,15 +8,15 @@ describe Message do
8
8
  let(:message) { Esendex::Message.new(to, body, from) }
9
9
 
10
10
  it "should have to set" do
11
- message.to.should eq(to)
11
+ expect(message.to).to eq(to)
12
12
  end
13
13
 
14
14
  it "should have from set" do
15
- message.from.should eq(from)
15
+ expect(message.from).to eq(from)
16
16
  end
17
17
 
18
18
  it "should have body set" do
19
- message.body.should eq(body)
19
+ expect(message.body).to eq(body)
20
20
  end
21
21
  end
22
22
 
@@ -28,10 +28,10 @@ describe Message do
28
28
  subject { message.xml_node }
29
29
 
30
30
  it "contains a to node" do
31
- subject.at_xpath('//message/to').content.should eq(to)
31
+ expect(subject.at_xpath('//message/to').content).to eq(to)
32
32
  end
33
33
  it "contains a body node" do
34
- subject.at_xpath('//message/body').content.should eq(body)
34
+ expect(subject.at_xpath('//message/body').content).to eq(body)
35
35
  end
36
36
 
37
37
  context "when #from set" do
@@ -42,7 +42,7 @@ describe Message do
42
42
  end
43
43
 
44
44
  it "contains a from node" do
45
- subject.at_xpath('//message/from').content.should eq(from)
45
+ expect(subject.at_xpath('//message/from').content).to eq(from)
46
46
  end
47
47
  end
48
48
  end
@@ -1,5 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rspec'
3
+ require 'rspec/collection_matchers'
3
4
 
4
5
  # Configure Rails Environment
5
6
  ENV["RAILS_ENV"] = "test"
@@ -10,19 +10,19 @@ describe VoiceMessage do
10
10
 
11
11
  context 'its xml' do
12
12
  it "contains to" do
13
- subject.at_xpath('//message/to').content.should eq(to)
13
+ expect(subject.at_xpath('//message/to').content).to eq(to)
14
14
  end
15
15
 
16
16
  it "contains body" do
17
- subject.at_xpath('//message/body').content.should eq(body)
17
+ expect(subject.at_xpath('//message/body').content).to eq(body)
18
18
  end
19
19
 
20
20
  it "contains type" do
21
- subject.at_xpath('//message/type').content.should eq('Voice')
21
+ expect(subject.at_xpath('//message/type').content).to eq('Voice')
22
22
  end
23
23
 
24
24
  it "contains language" do
25
- subject.at_xpath('//message/lang').content.should eq('en-GB')
25
+ expect(subject.at_xpath('//message/lang').content).to eq('en-GB')
26
26
  end
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esendex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bird
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nestful
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
- version: 1.4.4.1
36
+ version: 1.8.2
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '1.8'
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: 1.4.4.1
46
+ version: 1.8.2
41
47
  description: Send SMS from your application using the Esendex API
42
48
  email:
43
49
  - support@esendex.com
@@ -97,6 +103,7 @@ files:
97
103
  - spec/dummy/config/initializers/wrap_parameters.rb
98
104
  - spec/dummy/config/locales/en.yml
99
105
  - spec/dummy/config/routes.rb
106
+ - spec/dummy/log/test.log
100
107
  - spec/dummy/public/404.html
101
108
  - spec/dummy/public/422.html
102
109
  - spec/dummy/public/500.html
@@ -111,7 +118,8 @@ files:
111
118
  - spec/spec_helper.rb
112
119
  - spec/voice_message_spec.rb
113
120
  homepage: http://developers.esendex.com
114
- licenses: []
121
+ licenses:
122
+ - Nonstandard
115
123
  metadata: {}
116
124
  post_install_message:
117
125
  rdoc_options: []
@@ -119,9 +127,9 @@ require_paths:
119
127
  - lib
120
128
  required_ruby_version: !ruby/object:Gem::Requirement
121
129
  requirements:
122
- - - ">="
130
+ - - "~>"
123
131
  - !ruby/object:Gem::Version
124
- version: '0'
132
+ version: '2.2'
125
133
  required_rubygems_version: !ruby/object:Gem::Requirement
126
134
  requirements:
127
135
  - - ">="
@@ -129,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
137
  version: '0'
130
138
  requirements: []
131
139
  rubyforge_project:
132
- rubygems_version: 2.5.1
140
+ rubygems_version: 2.6.11
133
141
  signing_key:
134
142
  specification_version: 4
135
143
  summary: Gem for interacting with the Esendex API
@@ -158,6 +166,7 @@ test_files:
158
166
  - spec/dummy/config/locales/en.yml
159
167
  - spec/dummy/config/routes.rb
160
168
  - spec/dummy/config.ru
169
+ - spec/dummy/log/test.log
161
170
  - spec/dummy/public/404.html
162
171
  - spec/dummy/public/422.html
163
172
  - spec/dummy/public/500.html