vault-tools 0.5.11 → 0.5.12
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.
- data/Gemfile.lock +1 -1
- data/lib/vault-tools/statement_store.rb +2 -2
- data/lib/vault-tools/version.rb +1 -1
- data/test/statement_store_test.rb +3 -4
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -64,8 +64,8 @@ module Vault
|
|
64
64
|
# Determine the path on S3 for the given invoice
|
65
65
|
def path_for(opts = {})
|
66
66
|
validate_path_opts(opts)
|
67
|
-
start = DateTime.parse(opts[:start_time].to_s)
|
68
|
-
stop = DateTime.parse(opts[:stop_time].to_s)
|
67
|
+
start = DateTime.parse(opts[:start_time].to_s).strftime('%Y-%m-%d')
|
68
|
+
stop = DateTime.parse(opts[:stop_time].to_s).strftime('%Y-%m-%d')
|
69
69
|
user_hid = opts[:user_hid] || "user#{opts[:user_id]}@heroku.com"
|
70
70
|
sprintf('%s/%s/%s_v%s', start, stop, user_hid, opts[:version])
|
71
71
|
end
|
data/lib/vault-tools/version.rb
CHANGED
@@ -5,8 +5,7 @@ class StatementStoreTest < Vault::TestCase
|
|
5
5
|
super
|
6
6
|
StubbedS3.enable!(self)
|
7
7
|
StubbedS3.seed('vault-v2-json-invoice-test',
|
8
|
-
'2014-10-
|
9
|
-
'{"foo": 1}')
|
8
|
+
'2014-10-01/2014-11-01/user8@heroku.com_v2', '{"foo": 1}')
|
10
9
|
|
11
10
|
end
|
12
11
|
|
@@ -14,14 +13,14 @@ class StatementStoreTest < Vault::TestCase
|
|
14
13
|
inv = Vault::StatementStore.new(key_id: 'FAKE_ID', key: 'FAKE_KEY')
|
15
14
|
path = inv.path_for(start_time: '2014-10-01', stop_time: '2014-11-01',
|
16
15
|
user_id: 7, version: 2)
|
17
|
-
assert_equal '2014-10-
|
16
|
+
assert_equal '2014-10-01/2014-11-01/user7@heroku.com_v2', path
|
18
17
|
end
|
19
18
|
|
20
19
|
def test_invoice_path_with_user_hid
|
21
20
|
inv = Vault::StatementStore.new(key_id: 'FAKE_ID', key: 'FAKE_KEY')
|
22
21
|
path = inv.path_for(start_time: '2014-10-01', stop_time: '2014-11-01',
|
23
22
|
user_hid: 'user8@heroku.com', version: 2)
|
24
|
-
assert_equal '2014-10-
|
23
|
+
assert_equal '2014-10-01/2014-11-01/user8@heroku.com_v2', path
|
25
24
|
end
|
26
25
|
|
27
26
|
def test_retrieve_invoice_json
|