hellosign-ruby-sdk 3.0.14 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 626141caba5ec05372bc5eec029c0d1bd7392299
4
- data.tar.gz: cbc34e952f39e88495df35488fa8486b92d9009a
3
+ metadata.gz: 43c04f0a7b07bda2843fc33ab81fcf426deb0fc4
4
+ data.tar.gz: 3061262a5c8aa84d8f28b462b37d318b32c6b07d
5
5
  SHA512:
6
- metadata.gz: 8454b267bce08f8df6cefe965375829b223c694860b62646df40df5d5e849dea7eb47c7b81168d6edc4dd6c19d5525199dc028e93b2b3390a5a3b169cf6e2564
7
- data.tar.gz: df532383b9fd7fac6df9f8636e16074effc2d2b3a4b5759311fde8287dc4687b6a5883eee1f62ca468866538bdf4938656846d5c8aacbc01f3fe9770c2d8c0d6
6
+ metadata.gz: 8029438438f571a6835f9e7fba105c5358c6dda47f6a71c54571e32e97d206f6aabd528d177812119becf632378088ce790c83be0ff1c5610ba09a6e4634f6da
7
+ data.tar.gz: 69d32f61077e1db6197c335a5f86bad066a1f991ad71f3ccb9d8f9556b105a36bdfa6f35f231e85f9a6f0cd7f3aeab546e714cd0651428b4ac0bb045ba0b06ba
@@ -190,7 +190,7 @@ module HelloSign
190
190
  if opts[:files]
191
191
  opts[:files].each_with_index do |file, index|
192
192
  if file.is_a? String
193
- opts[:"file[#{index}]"] = Faraday::UploadIO.new(file, 'application/pdf')
193
+ opts[:"file[#{index}]"] = Faraday::UploadIO.new(StringIO.new(file), 'application/pdf')
194
194
  elsif defined? ActionDispatch::Http::UploadedFile
195
195
  if file.is_a? ActionDispatch::Http::UploadedFile
196
196
  opts[:"file[#{index}]"] = UploadIO.new(file.tempfile, 'application/pdf')
@@ -23,5 +23,5 @@
23
23
  #
24
24
 
25
25
  module HelloSign
26
- VERSION = '3.0.14'
26
+ VERSION = '3.0.15'
27
27
  end
Binary file
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Uploading File' do
4
+ describe 'Create Embedded Signature Request' do
5
+ before { stub_post('/signature_request/create_embedded', 'signature_request') }
6
+
7
+ it 'works with simple pdf' do
8
+ expect(HelloSign.create_embedded_signature_request({files: [load_file('empty.pdf')]}))
9
+ end
10
+
11
+ it 'works with null byte string' do
12
+ expect(HelloSign.create_embedded_signature_request({files: ["\0"]}))
13
+ end
14
+
15
+ it 'works with empty string' do
16
+ expect(HelloSign.create_embedded_signature_request({files: ['']}))
17
+ end
18
+ end
19
+
20
+ describe 'Create Unclaimed Draft' do
21
+ before { stub_post('/unclaimed_draft/create', 'unclaimed_draft') }
22
+
23
+ it 'works with simple pdf' do
24
+ expect(HelloSign.create_unclaimed_draft({files: [load_file('empty.pdf')]}))
25
+ end
26
+
27
+ it 'works with null byte string' do
28
+ expect(HelloSign.create_unclaimed_draft({files: ["\0"]}))
29
+ end
30
+
31
+ it 'works with empty string' do
32
+ expect(HelloSign.create_unclaimed_draft({files: ['']}))
33
+ end
34
+ end
35
+ end
data/spec/spec_helper.rb CHANGED
@@ -56,6 +56,10 @@ def load_fixture(name)
56
56
  File.new(File.dirname(__FILE__) + "/fixtures/#{name}.json")
57
57
  end
58
58
 
59
+ def load_file(name)
60
+ File.read(File.new(File.dirname(__FILE__) + "/fixtures/#{name}"))
61
+ end
62
+
59
63
  def stub_get(path, fixture, status_code=200)
60
64
  stub_request(:get, "#{HelloSign.end_point}#{HelloSign.api_version}#{path}").
61
65
  to_return(:body => load_fixture(fixture), :status => status_code)
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellosign-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.14
4
+ version: 3.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - HelloSign
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faraday
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: multi_json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: ''
@@ -100,9 +100,9 @@ executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
- - .gitignore
104
- - .rspec
105
- - .travis.yml
103
+ - ".gitignore"
104
+ - ".rspec"
105
+ - ".travis.yml"
106
106
  - Gemfile
107
107
  - Guardfile
108
108
  - LICENSE
@@ -134,6 +134,7 @@ files:
134
134
  - lib/hello_sign/version.rb
135
135
  - spec/fixtures/account.json
136
136
  - spec/fixtures/embedded.json
137
+ - spec/fixtures/empty.pdf
137
138
  - spec/fixtures/error.json
138
139
  - spec/fixtures/file.json
139
140
  - spec/fixtures/signature_request.json
@@ -153,6 +154,7 @@ files:
153
154
  - spec/hello_sign/client_spec.rb
154
155
  - spec/hello_sign/resource/base_resource_spec.rb
155
156
  - spec/hello_sign_spec.rb
157
+ - spec/scenarios/uploads_spec.rb
156
158
  - spec/spec_helper.rb
157
159
  homepage: http://www.hellosign.com
158
160
  licenses:
@@ -164,23 +166,24 @@ require_paths:
164
166
  - lib
165
167
  required_ruby_version: !ruby/object:Gem::Requirement
166
168
  requirements:
167
- - - '>='
169
+ - - ">="
168
170
  - !ruby/object:Gem::Version
169
171
  version: '0'
170
172
  required_rubygems_version: !ruby/object:Gem::Requirement
171
173
  requirements:
172
- - - '>='
174
+ - - ">="
173
175
  - !ruby/object:Gem::Version
174
176
  version: '0'
175
177
  requirements: []
176
178
  rubyforge_project:
177
- rubygems_version: 2.0.14
179
+ rubygems_version: 2.2.2
178
180
  signing_key:
179
181
  specification_version: 4
180
182
  summary: A Ruby SDK for the HelloSign API.
181
183
  test_files:
182
184
  - spec/fixtures/account.json
183
185
  - spec/fixtures/embedded.json
186
+ - spec/fixtures/empty.pdf
184
187
  - spec/fixtures/error.json
185
188
  - spec/fixtures/file.json
186
189
  - spec/fixtures/signature_request.json
@@ -200,4 +203,5 @@ test_files:
200
203
  - spec/hello_sign/client_spec.rb
201
204
  - spec/hello_sign/resource/base_resource_spec.rb
202
205
  - spec/hello_sign_spec.rb
206
+ - spec/scenarios/uploads_spec.rb
203
207
  - spec/spec_helper.rb