bitex 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,9 +51,9 @@ module Bitex
51
51
  self.class.from_json(Api.private(:put, "/private/kyc_profiles/#{id}", params))
52
52
  end
53
53
 
54
- def add_kyc_file!(path)
54
+ def add_kyc_file!(path, content_type = nil)
55
55
  response = Api.private(:post, "/private/kyc_profiles/#{id}/kyc_files",
56
- {}, {document: path})
56
+ {document_content_type: content_type}, {document: path})
57
57
  KycFile.from_json(response)
58
58
  end
59
59
 
data/lib/bitex/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bitex
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -120,6 +120,15 @@ describe Bitex::KycProfile do
120
120
  end
121
121
 
122
122
  it 'creates a kyc file' do
123
+ path = File.expand_path('../fixtures/file.jpg', __FILE__)
124
+ stub_private(:post, '/private/kyc_profiles/1/kyc_files', 'kyc_file',
125
+ {document: path, document_content_type: 'image/jpg'})
126
+ kyc_profile = Bitex::KycProfile.from_json(as_json)
127
+ kyc_file = kyc_profile.add_kyc_file!(path, 'image/jpg')
128
+ kyc_file.should be_a Bitex::KycFile
129
+ end
130
+
131
+ it 'creates a kyc file without specifying content type' do
123
132
  path = File.expand_path('../fixtures/file.jpg', __FILE__)
124
133
  stub_private(:post, '/private/kyc_profiles/1/kyc_files', 'kyc_file',
125
134
  {document: path})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-17 00:00:00.000000000 Z
13
+ date: 2014-10-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport