aaww 0.0.1 → 0.0.3
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 +4 -4
- data/lib/aaww/transaction.rb +2 -0
- data/lib/aaww/version.rb +1 -1
- data/test/test_transaction.rb +37 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f01ae663aa7e27fab44602d9b679da74357ffd29
|
4
|
+
data.tar.gz: bbac4615a80359de068e0b3fc52eac084c720bad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f941f269adb4875568c97147f148d2ab37069fcdec3b027874b11351ab00b057e0ece15402f98202c1574fe28ef47ecbe6986c3fc16ffc40f55a61c8deeb0d36
|
7
|
+
data.tar.gz: 7bc829032135d5899db31d279c764c761e61107dba9c043d1994906a3b2bf3f88a1395dd8f07efa0b66d7c9abf7a1aed3315b42846507dbc19981ae61a1e5036
|
data/lib/aaww/transaction.rb
CHANGED
data/lib/aaww/version.rb
CHANGED
data/test/test_transaction.rb
CHANGED
@@ -63,28 +63,49 @@ describe Aaww::Transaction do
|
|
63
63
|
end
|
64
64
|
|
65
65
|
describe '#upload!' do
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
66
|
+
describe 'with token' do
|
67
|
+
subject do
|
68
|
+
Aaww::Transaction.new key: 'fake_test_key', token: 'fake_test_token',
|
69
|
+
file: sample_stl, email: 'email@example.com', value: 1, job_id: 69
|
70
|
+
end
|
70
71
|
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
before do
|
73
|
+
VCR.use_cassette 'upload' do
|
74
|
+
@response = subject.upload!
|
75
|
+
end
|
74
76
|
end
|
75
|
-
end
|
76
77
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
78
|
+
it 'returns the response' do
|
79
|
+
@response.must_be_instance_of Hash
|
80
|
+
@response['status']['code'].must_equal 'ok'
|
81
|
+
end
|
81
82
|
|
82
|
-
|
83
|
-
|
83
|
+
it 'saves the link' do
|
84
|
+
subject.link.must_equal @response['data']['token_link']
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'saves the ssl link' do
|
88
|
+
subject.ssl_link.must_equal @response['data']['ssl_token_link']
|
89
|
+
end
|
84
90
|
end
|
85
91
|
|
86
|
-
|
87
|
-
subject
|
92
|
+
describe 'without token' do
|
93
|
+
subject do
|
94
|
+
Aaww::Transaction.new key: 'fake_test_key',
|
95
|
+
file: sample_stl, email: 'email@example.com', value: 1, job_id: 69
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'generates a token' do
|
99
|
+
subject.token.must_be_nil
|
100
|
+
|
101
|
+
VCR.use_cassette 'create_token' do
|
102
|
+
VCR.use_cassette 'upload' do
|
103
|
+
subject.upload!
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
subject.token.must_equal 'fake_test_token'
|
108
|
+
end
|
88
109
|
end
|
89
110
|
end
|
90
111
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aaww
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- La Inventoría
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httmultiparty
|