sms_aero 0.0.8 → 0.0.9
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/CHANGELOG.md +8 -2
- data/lib/sms_aero/operations/send_sms.rb +5 -1
- data/sms_aero.gemspec +1 -1
- data/spec/sms_aero/operations/send_sms_spec.rb +12 -1
- 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: 47495d4e60d1b2a8904d61a84e717e2dd07f45e6
|
4
|
+
data.tar.gz: d4f7bf8b15f966f5aa2995484caaa44a81e006f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4072ece391ff1ad9f1ebd508b9a89d39c70e6c95f9aecb4a6d85ddf08de1b10da031f5e94ec3a65601cd906199e00e367587ef6a17a288326e86be35a2324704
|
7
|
+
data.tar.gz: 036f412146078b61ec6d1fee915d4a98686de50301938e9c7e7e7b57879e4972365510aff4a805fb7f0fb41e8b672b6c9ebb1a2711075a990de512aa8274f214
|
data/CHANGELOG.md
CHANGED
@@ -4,12 +4,18 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [0.0.9] - [2017-06-23]
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
- Always add `#success` to answers to `#send_sms` (@nepalez)
|
11
|
+
|
7
12
|
## [0.0.8] - [2017-06-23]
|
8
13
|
|
9
14
|
### Added
|
10
15
|
- Weakened dependency from [dry-types], allowing v0.0.9 (@nepalez)
|
16
|
+
|
11
17
|
Between v0.9.0 and v0.9.1 an `optional` property has been broken.
|
12
|
-
Starting from sms_aero v1.0 [dry-types] will be removed from dependencies.
|
13
18
|
|
14
19
|
[dry-types]: https://github.com/dry-rb/dry-types
|
15
|
-
[0.0.8]: https://github.com/
|
20
|
+
[0.0.8]: https://github.com/nepalez/sms_aero/compare/v0.0.7...v0.0.8
|
21
|
+
[0.0.9]: https://github.com/nepalez/sms_aero/compare/v0.0.8...v0.0.9
|
@@ -12,7 +12,11 @@ class SmsAero
|
|
12
12
|
|
13
13
|
response :success, 200, format: :json, model: Answer do
|
14
14
|
attribute :id, proc(&:to_s)
|
15
|
-
attribute :success, default: proc {
|
15
|
+
attribute :success, default: proc { id != "" }
|
16
|
+
end
|
17
|
+
|
18
|
+
response :failure, 200, format: :json, model: Answer do
|
19
|
+
attribute :success, default: proc { false }
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
data/sms_aero.gemspec
CHANGED
@@ -3,6 +3,7 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
3
3
|
let(:client) { described_class.new(settings) }
|
4
4
|
let(:params) { { text: "Hi", to: "+7 (909) 382-84-45", from: "Qux" } }
|
5
5
|
let(:answer) { { id: 3898, result: "accepted" } }
|
6
|
+
let(:failure) { { reason: nil, result: "no credits" } }
|
6
7
|
|
7
8
|
before { stub_request(:any, //).to_return(body: answer.to_json) }
|
8
9
|
subject { client.send_sms(params) }
|
@@ -24,11 +25,21 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
24
25
|
expect(a_request(:post, url)).to have_been_made
|
25
26
|
end
|
26
27
|
|
27
|
-
it "returns
|
28
|
+
it "returns successful answer" do
|
28
29
|
expect(subject).to be_kind_of SmsAero::Answer
|
29
30
|
expect(subject.result).to eq "accepted"
|
31
|
+
expect(subject.id).to eq "3898"
|
30
32
|
expect(subject.success).to eq true
|
31
33
|
end
|
34
|
+
|
35
|
+
context "with a failure:" do
|
36
|
+
before { stub_request(:any, //).to_return(body: failure.to_json) }
|
37
|
+
|
38
|
+
it "returns unsuccessful answer" do
|
39
|
+
expect(subject).to be_kind_of SmsAero::Answer
|
40
|
+
expect(subject.success).to eq false
|
41
|
+
end
|
42
|
+
end
|
32
43
|
end
|
33
44
|
|
34
45
|
context "via GET:" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sms_aero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin (nepalez)
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.6.4
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: HTTP(s) client to SMS Aero API
|