sms_aero 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/sms_aero.rb +1 -0
- data/lib/sms_aero/operations/send_sms.rb +2 -2
- data/sms_aero.gemspec +1 -1
- data/spec/sms_aero/operations/send_sms_spec.rb +20 -0
- 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: 4d143f6adb80ea4198e0b76f1fc73cbbd9b30261
|
4
|
+
data.tar.gz: 7389794c1263faa2d1ea41bf91efdb720b86b747
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c78837a6cf3674ba89cf7249040fee4779291f85dda2494074e950432802d197a95b820a57b38bf7ba227393e4da382fa7f330d33c43d64cfcdf85289e8c5f7e
|
7
|
+
data.tar.gz: 0d445d01de621b8c1a43fd08f4327d72818c0d543510f653c6ec3b271191a5ab0fb6a00f1965414291a5147067830a300f126db6c7563726f5b89f1ecb76104b
|
data/README.md
CHANGED
@@ -26,7 +26,9 @@ See [operation specs][specs] for more verbose examples.
|
|
26
26
|
Initialize a client with user and password:
|
27
27
|
|
28
28
|
```ruby
|
29
|
-
client = SmsAero.new user: "joe",
|
29
|
+
client = SmsAero.new user: "joe", # required
|
30
|
+
password: "foobar", # required
|
31
|
+
test: true # optional - to send test SMS by default
|
30
32
|
```
|
31
33
|
|
32
34
|
Then send requests:
|
data/lib/sms_aero.rb
CHANGED
@@ -19,6 +19,7 @@ class SmsAero
|
|
19
19
|
option :password, Types::Password
|
20
20
|
option :use_ssl, Types::Form::Bool, default: proc { true }
|
21
21
|
option :use_post, Types::Form::Bool, default: proc { true }
|
22
|
+
option :test, Types::Form::Bool, default: proc { false }
|
22
23
|
end
|
23
24
|
|
24
25
|
base_url do |settings|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class SmsAero
|
2
|
-
operation :send_sms do
|
2
|
+
operation :send_sms do |settings|
|
3
3
|
documentation "https://smsaero.ru/api/description/#send-sms"
|
4
4
|
|
5
5
|
path do |test: false, **|
|
6
|
-
test ? "testsend" : "send"
|
6
|
+
settings.test || test ? "testsend" : "send"
|
7
7
|
end
|
8
8
|
|
9
9
|
query model: Sms do
|
data/sms_aero.gemspec
CHANGED
@@ -190,4 +190,24 @@ RSpec.describe SmsAero, "#send_sms" do
|
|
190
190
|
expect(a_request(:post, url)).to have_been_made
|
191
191
|
end
|
192
192
|
end
|
193
|
+
|
194
|
+
context "with preconfigured test:" do
|
195
|
+
let(:url) do
|
196
|
+
"https://gate.smsaero.ru/testsend?" \
|
197
|
+
"answer=json&" \
|
198
|
+
"from=Qux&" \
|
199
|
+
"password=9d1e4709d6a41407ab34cf99c7085f79&" \
|
200
|
+
"text=Hi&" \
|
201
|
+
"to=79093828445&" \
|
202
|
+
"type=2&" \
|
203
|
+
"user=BAZ"
|
204
|
+
end
|
205
|
+
|
206
|
+
before { settings[:test] = true }
|
207
|
+
|
208
|
+
it "sends a request" do
|
209
|
+
subject
|
210
|
+
expect(a_request(:post, url)).to have_been_made
|
211
|
+
end
|
212
|
+
end
|
193
213
|
end
|
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.0.
|
4
|
+
version: 0.0.6
|
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: 2017-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-types
|