assently 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.rspec +3 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +15 -0
  6. data/Gemfile +10 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +124 -0
  9. data/Rakefile +1 -0
  10. data/assently.gemspec +31 -0
  11. data/lib/assently/api_mappers/case_event_subscription_mapper.rb +12 -0
  12. data/lib/assently/api_mappers/case_mapper.rb +23 -0
  13. data/lib/assently/api_mappers/case_options_mapper.rb +74 -0
  14. data/lib/assently/api_mappers/document_mapper.rb +19 -0
  15. data/lib/assently/api_mappers/form_field_mapper.rb +12 -0
  16. data/lib/assently/api_mappers/party_mapper.rb +13 -0
  17. data/lib/assently/case.rb +50 -0
  18. data/lib/assently/case_event_subscription.rb +29 -0
  19. data/lib/assently/client.rb +129 -0
  20. data/lib/assently/document.rb +64 -0
  21. data/lib/assently/form_field.rb +3 -0
  22. data/lib/assently/id_generator.rb +10 -0
  23. data/lib/assently/party.rb +21 -0
  24. data/lib/assently/serializers/case_serializer.rb +15 -0
  25. data/lib/assently/version.rb +3 -0
  26. data/lib/assently.rb +14 -0
  27. data/spec/assently/api_mappers/case_event_subscription_mapper_spec.rb +23 -0
  28. data/spec/assently/api_mappers/case_mapper_spec.rb +34 -0
  29. data/spec/assently/api_mappers/case_options_mapper_spec.rb +92 -0
  30. data/spec/assently/api_mappers/document_mapper_spec.rb +35 -0
  31. data/spec/assently/api_mappers/form_field_mapper_spec.rb +19 -0
  32. data/spec/assently/api_mappers/party_mapper_spec.rb +24 -0
  33. data/spec/assently/case_event_subscription_spec.rb +18 -0
  34. data/spec/assently/case_spec.rb +68 -0
  35. data/spec/assently/client/create_case_spec.rb +55 -0
  36. data/spec/assently/client/get_case_spec.rb +84 -0
  37. data/spec/assently/client_spec.rb +207 -0
  38. data/spec/assently/document_spec.rb +126 -0
  39. data/spec/assently/form_field_spec.rb +18 -0
  40. data/spec/assently/id_generator_spec.rb +13 -0
  41. data/spec/assently/party_spec.rb +35 -0
  42. data/spec/assently/serializers/case_serializer_spec.rb +39 -0
  43. data/spec/assently_spec.rb +17 -0
  44. data/spec/fixtures/agreement.pdf +0 -0
  45. data/spec/fixtures/cassettes/Assently_Client/_create_case/valid_case.yml +75 -0
  46. data/spec/fixtures/cassettes/Assently_Client/_get_case/case_exists.yml +107 -0
  47. data/spec/fixtures/cassettes/Assently_Client/_get_case/case_missing.yml +43 -0
  48. data/spec/spec_helper.rb +38 -0
  49. metadata +225 -0
@@ -0,0 +1,207 @@
1
+ require "spec_helper"
2
+ require "assently/client"
3
+
4
+ RSpec.describe Assently::Client do
5
+ let :client do
6
+ Assently::Client.new "admin", "secret"
7
+ end
8
+
9
+ it "instantiates with api key and api secret" do
10
+ expect(client.api_key).to eq "admin"
11
+ expect(client.api_secret).to eq "secret"
12
+ end
13
+
14
+ describe "host" do
15
+ it "defaults to the production environment" do
16
+ expect(client.host).to eq "app.assently.com"
17
+ end
18
+
19
+ it "can be set to the test environment" do
20
+ test_host = "test.assently.com"
21
+
22
+ expect(Assently::Client.new("admin", "secret", :test).host).to eq test_host
23
+
24
+ client = Assently::Client.new "admin", "secret"
25
+ client.environment = :test
26
+
27
+ expect(client.host).to eq test_host
28
+ end
29
+ end
30
+
31
+ describe "#post" do
32
+ it "sends the json as the request body" do
33
+ stub_request(:post, "https://app.assently.com/some/path").
34
+ with({
35
+ basic_auth: ["admin", "secret"],
36
+ body: '{ "key": "value" }'
37
+ })
38
+
39
+ client.post "/some/path", '{ "key": "value" }'
40
+ end
41
+
42
+ describe "headers" do
43
+ it "sets application/json with utf8 charset" do
44
+ stub_request(:post, "https://app.assently.com/some/path").with({
45
+ basic_auth: ["admin", "secret"],
46
+ headers: { "content-type" => "application/json; charset=utf-8" }
47
+ })
48
+
49
+ client.post "/some/path", '{ "key": "value" }'
50
+ end
51
+ end
52
+
53
+ describe "returned result" do
54
+ it "is a success when successful status is returned" do
55
+ stub_request(:post, "https://app.assently.com/some/path").
56
+ with(basic_auth: ["admin", "secret"]).
57
+ to_return({
58
+ status: 200,
59
+ body: '{ "result": "Success" }'
60
+ })
61
+
62
+ result = client.post "/some/path"
63
+
64
+ expect(result).to be_a(Assently::Client::SuccessResult)
65
+ end
66
+
67
+ it "is not a success when non-success status is returned" do
68
+ stub_request(:post, "https://app.assently.com/some/path").
69
+ with(basic_auth: ["admin", "secret"]).
70
+ to_return({
71
+ status: 500,
72
+ body: '{ "result": "Failure" }'
73
+ })
74
+
75
+ result = client.post "/some/path"
76
+
77
+ expect(result).to be_a(Assently::Client::ErrorResult)
78
+ end
79
+ end
80
+ end
81
+
82
+ describe "#get" do
83
+ it "makes a get request" do
84
+ stub = stub_request(:get, "https://app.assently.com/some/path?key=value").
85
+ with({
86
+ basic_auth: ["admin", "secret"]
87
+ })
88
+
89
+ client.get "/some/path", { "key": "value" }
90
+
91
+ expect(stub).to have_been_requested
92
+ end
93
+
94
+ describe "returned result" do
95
+ it "is a success when successful status is returned" do
96
+ stub_request(:get, "https://app.assently.com/some/path").
97
+ with(basic_auth: ["admin", "secret"]).
98
+ to_return({ status: 200 })
99
+
100
+ result = client.get "/some/path"
101
+
102
+ expect(result).to be_a(Assently::Client::SuccessResult)
103
+ end
104
+
105
+ it "is not a success when non-success status is returned" do
106
+ stub_request(:get, "https://app.assently.com/some/path").
107
+ with(basic_auth: ["admin", "secret"]).
108
+ to_return({ status: 500 })
109
+
110
+ result = client.get "/some/path"
111
+
112
+ expect(result).to be_a(Assently::Client::ErrorResult)
113
+ end
114
+ end
115
+ end
116
+
117
+ describe "#connection" do
118
+ it "looks lika a http connection" do
119
+ expect(client.connection).to be_kind_of HTTP::Client
120
+ end
121
+
122
+ describe "authentication" do
123
+ it "uses basic auth" do
124
+ expect(client.connection.default_options.headers["Authorization"]).to eq "Basic YWRtaW46c2VjcmV0"
125
+ end
126
+ end
127
+
128
+ describe "accept header" do
129
+ it "accepts json" do
130
+ expect(client.connection.default_options.headers["Accept"]).to eq "application/json"
131
+ end
132
+ end
133
+ end
134
+
135
+ describe "Client::SuccessResult" do
136
+ before do
137
+ stub_request(:post, "https://app.assently.com/some/path").
138
+ with(basic_auth: ["admin", "secret"]).
139
+ to_return({
140
+ status: 200,
141
+ body: '{ "result": "Success" }'
142
+ })
143
+ end
144
+
145
+ describe "result" do
146
+ it "is successfull" do
147
+ result = client.post "/some/path"
148
+
149
+ expect(result.success?).to be true
150
+ end
151
+
152
+ it "parses the response json" do
153
+ result = client.post "/some/path"
154
+
155
+ expect(result.response).to eq("result" => "Success")
156
+ end
157
+
158
+ it "exposes the raw response" do
159
+ result = client.post "/some/path"
160
+
161
+ expect(result.raw).to eq('{ "result": "Success" }')
162
+ end
163
+
164
+ it "handles simple string bodies" do
165
+ stub_request(:post, "https://app.assently.com/some/path").
166
+ with(basic_auth: ["admin", "secret"]).
167
+ to_return({
168
+ status: 200,
169
+ body: "a string response"
170
+ })
171
+
172
+ result = client.post "/some/path"
173
+
174
+ expect(result.response).to eq "a string response"
175
+ end
176
+ end
177
+ end
178
+
179
+ describe "Client::ErrorResult" do
180
+ before do
181
+ stub_request(:post, "https://app.assently.com/some/path").
182
+ with(basic_auth: ["admin", "secret"]).
183
+ to_return({
184
+ status: 400,
185
+ body: '{"error":{"errorCode":"E041","message":"At least one signer is required."}}'
186
+ })
187
+ end
188
+
189
+ it "returns a error result" do
190
+ result = client.post "/some/path"
191
+
192
+ expect(result.success?).to be false
193
+ end
194
+
195
+ it "parses the error messages from the html body" do
196
+ result = client.post "/some/path"
197
+
198
+ expect(result.errors).to eq [ "E041 At least one signer is required." ]
199
+ end
200
+
201
+ it "exposes the raw response" do
202
+ result = client.post "/some/path"
203
+
204
+ expect(result.raw).to eq('{"error":{"errorCode":"E041","message":"At least one signer is required."}}')
205
+ end
206
+ end
207
+ end
@@ -0,0 +1,126 @@
1
+ require "spec_helper"
2
+ require "assently/document"
3
+
4
+ module Assently
5
+ RSpec.describe Document do
6
+ let :fixture_path do
7
+ File.join(Dir.pwd, "spec/fixtures/agreement.pdf")
8
+ end
9
+
10
+ let :fixture_contents do
11
+ File.read(fixture_path)
12
+ end
13
+
14
+
15
+ describe "with a local file" do
16
+ let :document do
17
+ Document.new fixture_path
18
+ end
19
+
20
+ describe "#filename" do
21
+ it "defaults to the file's basename" do
22
+ expect(document.filename).to eq "agreement.pdf"
23
+ end
24
+
25
+ it "can be set in the constructor" do
26
+ document = Document.new fixture_path, filename: "special-agreement.pdf"
27
+
28
+ expect(document.filename).to eq "special-agreement.pdf"
29
+ end
30
+ end
31
+
32
+ specify "#size" do
33
+ expect(document.size).to eq 6925
34
+ end
35
+
36
+ specify "#content_type" do
37
+ expect(document.content_type).to eq "application/pdf"
38
+ end
39
+
40
+ it "has the file data encoded as base64" do
41
+ expect(document.data).to eq Base64.encode64(File.open(fixture_path).read)
42
+ end
43
+ end
44
+
45
+ describe "#with an url" do
46
+ before do
47
+ stub_request(:get, "http://example.com/files/remote_agreement.pdf").to_return({
48
+ status: 200,
49
+ body: fixture_contents
50
+ })
51
+ end
52
+
53
+ let :document do
54
+ Document.new "http://example.com/files/remote_agreement.pdf"
55
+ end
56
+
57
+ specify "#filename" do
58
+ expect(document.filename).to eq "remote_agreement.pdf"
59
+ end
60
+
61
+ specify "#size" do
62
+ expect(document.size).to eq 6925
63
+ end
64
+
65
+ specify "#content_type" do
66
+ expect(document.content_type).to eq "application/pdf"
67
+ end
68
+
69
+ it "has the file data encoded as base64" do
70
+ expect(document.data).to eq Base64.encode64(fixture_contents)
71
+ end
72
+
73
+ describe "that is protected by basic authentication" do
74
+ describe "with valid credentials" do
75
+ let :url do
76
+ "example.com/files/protected_file.pdf"
77
+ end
78
+
79
+ before do
80
+ stub_request(:get, "@#{url}").
81
+ with(basic_auth: ["test-user", "secret"]).
82
+ to_return({
83
+ status: 200,
84
+ body: "the-body"
85
+ })
86
+ end
87
+
88
+ it "returns the document" do
89
+ document = Document.new("http://#{url}", username: "test-user", password: "secret")
90
+
91
+ expect(document.data).to eq Base64.encode64("the-body")
92
+ end
93
+ end
94
+
95
+ describe "with invalid credentials" do
96
+ let :url do
97
+ "http://example.com/files/protected_file.pdf"
98
+ end
99
+
100
+ before do
101
+ stub_request(:get, url).to_return({
102
+ status: [401, "Unauthorized"]
103
+ })
104
+ end
105
+
106
+ it "throws a informative error if it cannot authenticate" do
107
+ document = Document.new(url)
108
+
109
+ expect{
110
+ document.size
111
+ }.to raise_error(Assently::CouldNotFetchDocumentError, /#{url}/)
112
+ end
113
+ end
114
+ end
115
+ end
116
+
117
+ it "adds form fields" do
118
+ document = Document.new fixture_contents
119
+ form_field = double "FormField", name: "FieldName", value: "Some Value"
120
+
121
+ document.add_form_field form_field
122
+
123
+ expect(document.form_fields).to eq [form_field]
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+ require "assently/form_field"
3
+
4
+ module Assently
5
+ RSpec.describe FormField do
6
+ let :form_field do
7
+ FormField.new "A name", "Some value"
8
+ end
9
+
10
+ specify "#name" do
11
+ expect(form_field.name).to eq "A name"
12
+ end
13
+
14
+ specify "#value" do
15
+ expect(form_field.value).to eq "Some value"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ require "spec_helper"
2
+ require "assently/id_generator"
3
+
4
+ module Assently
5
+ RSpec.describe IdGenerator do
6
+ describe ".generate" do
7
+ it ".returns a new id generated with SecureRandom" do
8
+ expect(SecureRandom).to receive(:uuid).and_return "very-random"
9
+ expect(IdGenerator.generate).to eq "very-random"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+ require "assently/party"
3
+
4
+ module Assently
5
+ RSpec.describe Party do
6
+ describe ".new_with_attributes" do
7
+ let :party do
8
+ Party.new_with_attributes({
9
+ name: "Jane Doe",
10
+ email: "jane@example.com",
11
+ social_security_number: "191302275522"
12
+ })
13
+ end
14
+
15
+ it "sets the name" do
16
+ expect(party.name).to eq "Jane Doe"
17
+ end
18
+
19
+ it "sets the email address" do
20
+ expect(party.email).to eq "jane@example.com"
21
+ end
22
+
23
+ it "has a social security number" do
24
+ expect(party.social_security_number).to eq "191302275522"
25
+ end
26
+ end
27
+
28
+ it "strips unwanted input from social security number" do
29
+ party = Party.new
30
+ party.social_security_number = "1913 02 27 - 5522"
31
+
32
+ expect(party.social_security_number).to eq "191302275522"
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,39 @@
1
+ require "spec_helper"
2
+
3
+ require "assently/case"
4
+ require "assently/serializers/case_serializer"
5
+
6
+ module Assently
7
+ module Serializers
8
+ RSpec.describe CaseSerializer do
9
+ describe ".serialize" do
10
+ it "maps the case to a api representation and return it as json" do
11
+ signature_case = double "Assently::Case"
12
+ api_hash = { "The" => "Case" }
13
+
14
+ expect(Assently::ApiMappers::CaseMapper).to receive(:to_api).with(signature_case).and_return api_hash
15
+
16
+ expect(CaseSerializer.serialize(signature_case)).to eq JSON.pretty_generate(api_hash)
17
+ end
18
+
19
+ it "maps event subscription" do
20
+ api_hash = { "The" => "Case" }
21
+ signature_case = double "Assently::Case"
22
+ event_subscription = double "Assently::CaseEventSubscription", events: ["finished", "rejected"], url: "http://example.com"
23
+ options = { event_callback: event_subscription }
24
+ options_hash = {
25
+ "EventCallback" => {
26
+ "Events" => ["finished", "rejected"],
27
+ "Url" => "http://example.com"
28
+ }
29
+ }
30
+
31
+ expect(Assently::ApiMappers::CaseMapper).to receive(:to_api).with(signature_case).and_return api_hash
32
+ expect(Assently::ApiMappers::CaseOptionsMapper).to receive(:to_api).with(options).and_return options_hash
33
+
34
+ expect(CaseSerializer.serialize(signature_case, options)).to eq JSON.pretty_generate(api_hash.merge(options_hash))
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+ require "assently"
3
+
4
+ RSpec.describe Assently do
5
+ describe ".client" do
6
+ it "returns a Assently::Client" do
7
+ expect(Assently.client("admin", "secret")).to be_kind_of Assently::Client
8
+ end
9
+
10
+ it "passes arguments to the client" do
11
+ client = Assently.client "admin", "secret"
12
+
13
+ expect(client.api_key).to eq "admin"
14
+ expect(client.api_secret).to eq "secret"
15
+ end
16
+ end
17
+ end
Binary file
@@ -0,0 +1,75 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://test.assently.com/api/v2/createcase
6
+ body:
7
+ encoding: UTF-8
8
+ string: |-
9
+ {
10
+ "Id": "ce7dd6e7-bcda-4340-a9c7-6f1e51786a34",
11
+ "Name": "Agreement",
12
+ "NameAlias": "Agreement_alias",
13
+ "Documents": [
14
+ {
15
+ "Filename": "agreement.pdf",
16
+ "Data": "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAg\nUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAFFjrEKwkAQRHu/\n4pVaeNlN7nKxVQTbwIIfcMZCoiFJ4e+7YmE1zMxjmJmemVyTYwypjcSk1CnE\nphVlGbjyojqtSlkR1uK0hEPuGunEA2H/t9+ZLJvy5GhOifiEFVR/oGtCBXtS\nmSle3tlehnGceE/LeAs77MHZ/FP/ARUJIsAKZW5kc3RyZWFtCmVuZG9iago1\nIDAgb2JqCjEyOAplbmRvYmoKMiAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFy\nZW50IDMgMCBSIC9SZXNvdXJjZXMgNiAwIFIgL0NvbnRlbnRzIDQgMCBSIC9N\nZWRpYUJveCBbMCAwIDU5NSA4NDJdCj4+CmVuZG9iago2IDAgb2JqCjw8IC9Q\ncm9jU2V0IFsgL1BERiAvVGV4dCBdIC9Db2xvclNwYWNlIDw8IC9DczEgNyAw\nIFIgPj4gL0ZvbnQgPDwgL1RUMSA4IDAgUgo+PiA+PgplbmRvYmoKOSAwIG9i\nago8PCAvTGVuZ3RoIDEwIDAgUiAvTiAxIC9BbHRlcm5hdGUgL0RldmljZUdy\nYX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MDAwMDA2\nMDIyIDAwMDAwIG4gCjAwMDAwMDYwNDkgMDAwMDAgbiAKMDAwMDAwNjA5MSAw\nMDAwMCBuIAowMDAwMDA2MTEwIDAwMDAwIG4gCnRyYWlsZXIKPDwgL1NpemUg\nMjMgL1Jvb3QgMTEgMCBSIC9JbmZvIDEgMCBSIC9JRCBbIDwwYzY4NDVjYjUx\nMTNiMDc0NzIyNGVhZGE2ZjA5NjAyND4KPDBjNjg0NWNiNTExM2IwNzQ3MjI0\nZWFkYTZmMDk2MDI0PiBdID4+CnN0YXJ0eHJlZgo2MzA4CiUlRU9GCg==\n",
17
+ "ContentType": "application/pdf",
18
+ "Size": 6925,
19
+ "FormFields": [
20
+
21
+ ]
22
+ }
23
+ ],
24
+ "Parties": [
25
+ {
26
+ "Name": "First Last",
27
+ "EmailAddress": "name@example.com",
28
+ "SocialSecurityNumber": "2405062254"
29
+ }
30
+ ],
31
+ "AllowedSignatureTypes": [
32
+ "touch"
33
+ ],
34
+ "CaseReferenceId": "e0d458e6-bdac-4d8b-80e6-bf468b9a2b0f",
35
+ "ContinueName": "Back to the site",
36
+ "ContinueUrl": "http://example.com/thanks",
37
+ "ContinueAuto": true,
38
+ "CancelUrl": "http://example.com/sorry",
39
+ "Procedure": "form",
40
+ "Culture": "sv-SE"
41
+ }
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Authorization:
46
+ - Basic <ASSENTLY_API_AUTH_HEADER>
47
+ User-Agent:
48
+ - Faraday v0.11.0
49
+ Content-Type:
50
+ - application/json; charset=utf-8
51
+ Accept-Encoding:
52
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
+ response:
54
+ status:
55
+ code: 200
56
+ message: OK
57
+ headers:
58
+ Cache-Control:
59
+ - private, s-maxage=0
60
+ X-Frame-Options:
61
+ - SAMEORIGIN
62
+ Set-Cookie:
63
+ - sid=tc1muzjfyfsfqo05joyuxjr5; path=/; HttpOnly; Secure
64
+ Date:
65
+ - Thu, 26 Jan 2017 20:23:50 GMT
66
+ Content-Length:
67
+ - '0'
68
+ Strict-Transport-Security:
69
+ - max-age=31536000
70
+ body:
71
+ encoding: UTF-8
72
+ string: ''
73
+ http_version:
74
+ recorded_at: Thu, 26 Jan 2017 20:23:50 GMT
75
+ recorded_with: VCR 3.0.3