rs4 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rs4/version.rb +1 -1
- data/lib/test/mock_request.rb +114 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8edb979aea62c9329b7a46903ecbcd1821a6c06095529ae43706b87f4035a944
|
4
|
+
data.tar.gz: 8bf89c83e2c4c62a4c3cbbe5b1706e3e330e62fbfbda634da22d10cc2deb7355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1141f8182f210b2752da9b4ec45609448a9bb8cd5de2eb96034c90e95b89a16d416fbabc82e368d72d5b95735ea13bf90f6f2d6b4f8a492ad438a8d2218e1dc
|
7
|
+
data.tar.gz: 29d24cebaace5128a40bad69153cad70112bd2a8bceb461a1487a364b7bfe9db361113c621ba6092f7e7e6166d9a01b8b6e39b86edfa7ac370d4f04916477561
|
data/lib/rs4/version.rb
CHANGED
@@ -0,0 +1,114 @@
|
|
1
|
+
module RS4
|
2
|
+
class MockRequest
|
3
|
+
class << self
|
4
|
+
def execute(path, method = :get, _body = {})
|
5
|
+
mockument = {
|
6
|
+
id: SecureRandom.uuid,
|
7
|
+
current_signer_id: 0,
|
8
|
+
name: 'noname',
|
9
|
+
filename: 'noname.pdf',
|
10
|
+
executed_at: Date.today,
|
11
|
+
expired_at: Date.today + 1.day,
|
12
|
+
sent_at: Date.today,
|
13
|
+
state: 'draft',
|
14
|
+
thumbnail_url: 'google.com',
|
15
|
+
sender: 'sender',
|
16
|
+
recipients: [
|
17
|
+
{
|
18
|
+
role_name: 'Investor',
|
19
|
+
sign_url: 'www.google.com'
|
20
|
+
}
|
21
|
+
],
|
22
|
+
audits: nil,
|
23
|
+
page_image_urls: 'google.com',
|
24
|
+
signed_pdf_url: 'google.com/pdf.pdf',
|
25
|
+
tags: nil,
|
26
|
+
merge_field_values: nil,
|
27
|
+
embed_codes: nil,
|
28
|
+
in_person: true,
|
29
|
+
shared_with: nil,
|
30
|
+
identity_method: nil,
|
31
|
+
passcode_pin_enabled: false,
|
32
|
+
original_file_url: 'google.com'
|
33
|
+
}
|
34
|
+
|
35
|
+
if _body&.dig(:roles)&.any?
|
36
|
+
|
37
|
+
mockument[:recipients] = []
|
38
|
+
|
39
|
+
_body[:roles].each do |role|
|
40
|
+
mockument[:recipients] << {
|
41
|
+
role_name: role[:name],
|
42
|
+
sign_url: 'www.google.com'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
mockplate = {
|
48
|
+
id: SecureRandom.uuid,
|
49
|
+
name: 'template',
|
50
|
+
creator: 'creator',
|
51
|
+
expires_in: Date.today + 1.day,
|
52
|
+
signer_sequencing: false,
|
53
|
+
shared_with: nil,
|
54
|
+
distribution_method: nil,
|
55
|
+
identity_method: nil,
|
56
|
+
kba: nil,
|
57
|
+
passcode: nil,
|
58
|
+
filename: 'template.pdf',
|
59
|
+
tags: nil,
|
60
|
+
user_id: 1,
|
61
|
+
roles: [],
|
62
|
+
merge_field_components: [],
|
63
|
+
created_at: Date.today,
|
64
|
+
updated_at: Date.today,
|
65
|
+
thumbnail_url: 'google.com/pdf.pdf',
|
66
|
+
page_image_urls: 'google.com/image'
|
67
|
+
}
|
68
|
+
|
69
|
+
case path
|
70
|
+
when %r{reusable_templates/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/send_document}
|
71
|
+
return {
|
72
|
+
document: mockument
|
73
|
+
}
|
74
|
+
when %r{reusable_templates/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}}
|
75
|
+
return {
|
76
|
+
reusable_template: mockplate
|
77
|
+
}
|
78
|
+
when /reusable_templates/
|
79
|
+
results = {
|
80
|
+
reusable_templates: []
|
81
|
+
}
|
82
|
+
|
83
|
+
i = 0
|
84
|
+
while i < 3
|
85
|
+
mockplate[:id] = SecureRandom.uuid
|
86
|
+
results[:reusable_templates] << mockplate
|
87
|
+
i += 1
|
88
|
+
end
|
89
|
+
|
90
|
+
return results
|
91
|
+
when %r{documents/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}}
|
92
|
+
return {
|
93
|
+
document: mockument
|
94
|
+
}
|
95
|
+
|
96
|
+
when /documents/
|
97
|
+
Rails.logger.info("#{method} documents")
|
98
|
+
|
99
|
+
results = {
|
100
|
+
documents: []
|
101
|
+
}
|
102
|
+
i = 0
|
103
|
+
while i < 3
|
104
|
+
results[:documents] << mockument
|
105
|
+
i += 1
|
106
|
+
end
|
107
|
+
|
108
|
+
return results
|
109
|
+
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rs4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- donny
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- lib/rs4/request_error.rb
|
35
35
|
- lib/rs4/reusable_template.rb
|
36
36
|
- lib/rs4/version.rb
|
37
|
+
- lib/test/mock_request.rb
|
37
38
|
- license.txt
|
38
39
|
- rs4.gemspec
|
39
40
|
homepage: https://github.com/equitymultiple/rs4
|