sms_aero 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sms_aero.rb +1 -1
- data/lib/sms_aero/channel.rb +1 -1
- data/sms_aero.gemspec +1 -1
- data/spec/models/channel_spec.rb +3 -3
- data/spec/operations/send_sms_spec.rb +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23e743ac4212a9a6a84d86212d0a00351b985e44
|
4
|
+
data.tar.gz: f985838a08b4d01cb5ee1b5f9719bef0b69e90de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a827cb1a64b25448b0913b3d1b95dab83ed55f260d275e9f46a43fe3bfdd40d5be1be487a11b0aabb4cbabe7e49fb9182d71cead3d310dbf97f4bfa5fb94076
|
7
|
+
data.tar.gz: c3a692c580cb508831f18cf65e021187f8e899c943a2fd31ac65f808e47a5be5ded8f209d94f1b504d308259905707e7dcb92bee4034862e97730b630bd0a353
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
|
+
## [0.2.0] - [2018-04-27]
|
9
|
+
- fix channel types from the API v1 docs (jarosluv)
|
10
|
+
|
8
11
|
## [0.1.3] - [2018-01-05]
|
9
12
|
|
10
13
|
### Changed
|
@@ -57,3 +60,4 @@ Some changes in the interface has been made as well.
|
|
57
60
|
[0.1.1]: https://github.com/nepalez/sms_aero/compare/v0.1.0...v0.1.1
|
58
61
|
[0.1.2]: https://github.com/nepalez/sms_aero/compare/v0.1.1...v0.1.2
|
59
62
|
[0.1.3]: https://github.com/nepalez/sms_aero/compare/v0.1.2...v0.1.3
|
63
|
+
[0.2.0]: https://github.com/nepalez/sms_aero/compare/v0.1.3...v0.2.0
|
data/lib/sms_aero.rb
CHANGED
@@ -132,7 +132,7 @@ class SmsAero < Evil::Client
|
|
132
132
|
option :text, FilledString
|
133
133
|
option :date, Future, optional: true
|
134
134
|
option :digital, Digital, optional: true
|
135
|
-
option :type, Channel, default: -> {
|
135
|
+
option :type, Channel, default: -> { 5 unless digital == 1 }
|
136
136
|
|
137
137
|
validate { errors.add :missed_address unless !to ^ !group }
|
138
138
|
|
data/lib/sms_aero/channel.rb
CHANGED
@@ -9,7 +9,7 @@ class SmsAero::Channel < String
|
|
9
9
|
|
10
10
|
def initialize(value)
|
11
11
|
channel = value.to_s
|
12
|
-
return super(channel) if %w(
|
12
|
+
return super(channel) if %w(4 5 6 7 8).include? channel
|
13
13
|
raise "Incorrect value #{channel} for channel"
|
14
14
|
end
|
15
15
|
end
|
data/sms_aero.gemspec
CHANGED
data/spec/models/channel_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe SmsAero::Channel do
|
4
4
|
context "valid code:" do
|
5
|
-
let(:codes) { [
|
5
|
+
let(:codes) { [4, 5, 6, 7, 8] }
|
6
6
|
|
7
7
|
it "returns a code" do
|
8
8
|
codes.each { |code| expect(described_class[code]).to eq code.to_s }
|
@@ -10,10 +10,10 @@ RSpec.describe SmsAero::Channel do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
context "invalid code:" do
|
13
|
-
let(:code) {
|
13
|
+
let(:code) { 3 }
|
14
14
|
|
15
15
|
it "fails" do
|
16
|
-
expect { described_class[code] }.to raise_error(StandardError, /
|
16
|
+
expect { described_class[code] }.to raise_error(StandardError, /3/)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -16,7 +16,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
16
16
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
17
17
|
"text=Hi&" \
|
18
18
|
"to=79093828445&" \
|
19
|
-
"type=
|
19
|
+
"type=5&" \
|
20
20
|
"user=BAZ"
|
21
21
|
end
|
22
22
|
|
@@ -53,7 +53,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
53
53
|
"group=readers&" \
|
54
54
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
55
55
|
"text=Hi&" \
|
56
|
-
"type=
|
56
|
+
"type=5&" \
|
57
57
|
"user=BAZ"
|
58
58
|
end
|
59
59
|
|
@@ -71,7 +71,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
71
71
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
72
72
|
"text=Hi&" \
|
73
73
|
"to=79093828445&" \
|
74
|
-
"type=
|
74
|
+
"type=5&" \
|
75
75
|
"user=BAZ"
|
76
76
|
end
|
77
77
|
|
@@ -91,7 +91,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
91
91
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
92
92
|
"text=Hi&" \
|
93
93
|
"to=79093828445&" \
|
94
|
-
"type=
|
94
|
+
"type=5&" \
|
95
95
|
"user=BAZ"
|
96
96
|
end
|
97
97
|
|
@@ -145,7 +145,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
145
145
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
146
146
|
"text=Hi&" \
|
147
147
|
"to=79093828445&" \
|
148
|
-
"type=
|
148
|
+
"type=5&" \
|
149
149
|
"user=BAZ"
|
150
150
|
end
|
151
151
|
|
@@ -201,11 +201,11 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
201
201
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
202
202
|
"text=Hi&" \
|
203
203
|
"to=79093828445&" \
|
204
|
-
"type=
|
204
|
+
"type=4&" \
|
205
205
|
"user=BAZ"
|
206
206
|
end
|
207
207
|
|
208
|
-
before { params[:type] =
|
208
|
+
before { params[:type] = 4 }
|
209
209
|
|
210
210
|
it "sends a request" do
|
211
211
|
subject
|
@@ -229,7 +229,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
229
229
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
230
230
|
"text=Hi&" \
|
231
231
|
"to=79093828445&" \
|
232
|
-
"type=
|
232
|
+
"type=5&" \
|
233
233
|
"user=BAZ"
|
234
234
|
end
|
235
235
|
|
@@ -249,7 +249,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
249
249
|
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
250
250
|
"text=Hi&" \
|
251
251
|
"to=79093828445&" \
|
252
|
-
"type=
|
252
|
+
"type=5&" \
|
253
253
|
"user=BAZ"
|
254
254
|
end
|
255
255
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sms_aero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin (nepalez)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evil-client
|