rs.ge 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rs/requests/sys.rb +5 -5
- data/lib/rs/version.rb +1 -1
- data/spec/requests/sys_spec.rb +34 -34
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8848e7c233edf215bb5e22de3b30654f3b7d8169
|
4
|
+
data.tar.gz: 6a2702615b0872b8be648ee7dcd9508a1ff641eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e8442cc394639f06989d90c1b118d719861717ceb8162e9344c7903d66875997da11b9b232d24eb4940acbe91c852bee6961dd1c1d91689ae5494ffa6fd7e3b
|
7
|
+
data.tar.gz: b6602062cd001a5aa228b9fd38b528507209486259c665938e66141e8af952fe79288e4322b2c34816c0fdbf25ea8e9f8b95d5a981903c9b621b6ce68f30fa28
|
data/lib/rs/requests/sys.rb
CHANGED
@@ -59,11 +59,11 @@ module RS
|
|
59
59
|
# * `su` -- user login
|
60
60
|
# * `sp` -- user's passwrod
|
61
61
|
def update_user(opts)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
validate_presence_of(opts, :username, :password, :ip, :name, :su, :sp)
|
63
|
+
response = waybill_client.request 'update_service_user' do
|
64
|
+
soap.body = {'user_name' => opts[:username], 'user_password' => opts[:password], 'ip' => opts[:ip], 'name' => opts[:name], 'su' => opts[:su], 'sp' => opts[:sp]}
|
65
|
+
end
|
66
|
+
response.to_hash[:update_service_user_response][:update_service_user_result]
|
67
67
|
end
|
68
68
|
|
69
69
|
# Check service user. Also used for getting user's ID and payer's ID.
|
data/lib/rs/version.rb
CHANGED
data/spec/requests/sys_spec.rb
CHANGED
@@ -11,40 +11,40 @@ describe 'getting own IP address' do
|
|
11
11
|
it { should match /([0-9]{1,3}\.){3}[0-9]{1,3}/ }
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
|
22
|
-
#
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
14
|
+
describe 'working with service user' do
|
15
|
+
before(:all) do
|
16
|
+
@username = "tbilisi"
|
17
|
+
@password = '123456'
|
18
|
+
@new_password = 'new_password_123456'
|
19
|
+
@ip = RS.sys.what_is_my_ip
|
20
|
+
# @resp = RS.sys.create_user(USER01.merge(ip: @ip, name: 'test', su: @username, sp: @password))
|
21
|
+
end
|
22
|
+
# subject { @resp }
|
23
|
+
# it { should == true }
|
24
|
+
describe 'update service user' do
|
25
|
+
before(:all) do
|
26
|
+
@resp = RS.sys.update_user(USER01.merge(ip: @ip, name: 'test', su: @username, sp: @new_password))
|
27
|
+
end
|
28
|
+
subject { @resp }
|
29
|
+
it { should == true }
|
30
|
+
end
|
31
|
+
describe 'check service user: illegal user/password' do
|
32
|
+
before(:all) do
|
33
|
+
@resp = RS.sys.check_user(su: @username, sp: @password)
|
34
|
+
end
|
35
|
+
subject { @resp }
|
36
|
+
it { should be_nil }
|
37
|
+
end
|
38
|
+
describe 'check service user: legal user/password' do
|
39
|
+
before(:all) do
|
40
|
+
@resp = RS.sys.check_user(su: @username, sp: @new_password)
|
41
|
+
end
|
42
|
+
subject { @resp }
|
43
|
+
it { should_not be_nil }
|
44
|
+
specify { subject[:payer].should_not be_nil }
|
45
|
+
specify { subject[:user].should_not be_nil }
|
46
|
+
end
|
47
|
+
end
|
48
48
|
|
49
49
|
describe 'get error codes' do
|
50
50
|
before(:all) do
|