-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfax_api_spec.rb
More file actions
69 lines (49 loc) · 2.03 KB
/
fax_api_spec.rb
File metadata and controls
69 lines (49 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
=begin
#Dropbox Sign API
#Dropbox Sign v3 API
The version of the OpenAPI document: 3.0.0
Contact: apisupport@hellosign.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.3.0
=end
require 'spec_helper'
require 'json_spec'
require_relative '../test_utils'
root_file_path = __dir__ + "/../../test_fixtures"
describe Dropbox::Sign::FaxApi do
context 'FaxApiTest' do
api = Dropbox::Sign::FaxApi.new
it 'testFaxSend' do
request_class = 'FaxSendRequest'
request_data = get_fixture_data(request_class)[:default]
response_class = 'FaxGetResponse'
response_data = get_fixture_data(response_class)[:default]
set_expected_response(200, JSON.dump(response_data))
expected = Dropbox::Sign::FaxGetResponse.init(response_data)
obj = Dropbox::Sign::FaxSendRequest.init(request_data)
obj.files = [File.new("#{root_file_path}/pdf-sample.pdf", "r")]
result = api.fax_send(obj)
expect(result.class.to_s).to eq("Dropbox::Sign::#{response_class}")
expect(result.to_json).to be_json_eql(JSON.dump(expected))
end
it 'testFaxGet' do
signature_request_id = 'c2e9691c85d9d6fa6ae773842e3680b2b8650f1d'
response_class = 'FaxGetResponse'
response_data = get_fixture_data(response_class)[:default]
set_expected_response(200, JSON.dump(response_data))
expected = Dropbox::Sign::FaxGetResponse.init(response_data)
result = api.fax_get(signature_request_id)
expect(result.class.to_s).to eq("Dropbox::Sign::#{response_class}")
expect(result.to_json).to be_json_eql(JSON.dump(expected))
end
it 'testFaxList' do
response_class = 'FaxListResponse'
response_data = get_fixture_data(response_class)[:default]
set_expected_response(200, JSON.dump(response_data))
expected = Dropbox::Sign::FaxListResponse.init(response_data)
result = api.fax_list()
expect(result.class.to_s).to eq("Dropbox::Sign::#{response_class}")
expect(result.to_json).to be_json_eql(JSON.dump(expected))
end
end
end