kaui 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/app/controllers/kaui/accounts_controller.rb +12 -2
  2. data/app/controllers/kaui/bundles_controller.rb +1 -1
  3. data/app/controllers/kaui/invoice_items_controller.rb +11 -0
  4. data/app/controllers/kaui/invoices_controller.rb +3 -0
  5. data/app/controllers/kaui/refunds_controller.rb +12 -2
  6. data/app/controllers/kaui/subscriptions_controller.rb +1 -1
  7. data/app/helpers/kaui/killbill_helper.rb +35 -10
  8. data/app/models/kaui/account.rb +6 -0
  9. data/app/models/kaui/refund.rb +2 -1
  10. data/app/views/kaui/account_timelines/show.html.erb +104 -46
  11. data/app/views/kaui/accounts/show.html.erb +32 -3
  12. data/app/views/kaui/invoices/show.html.erb +25 -2
  13. data/app/views/kaui/refunds/new.html.erb +212 -15
  14. data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +25 -3
  15. data/config/routes.rb +2 -1
  16. data/lib/kaui/version.rb +1 -1
  17. data/test/dummy/app/assets/javascripts/application.js +1 -0
  18. data/test/dummy/log/development.log +13530 -0
  19. data/test/dummy/log/test.log +1634 -0
  20. data/test/dummy/test/fixtures/refunds.yml +2 -1
  21. data/test/dummy/tmp/cache/assets/C8D/080/sprockets%2F4556c595251e3b8d4f688467e330da26 +0 -0
  22. data/test/dummy/tmp/cache/assets/CFF/A00/sprockets%2F642f58fb154eff788f45c881b294e818 +0 -0
  23. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  24. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  25. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  26. data/test/dummy/tmp/pids/server.pid +1 -0
  27. data/test/test_helper.rb +6 -2
  28. data/test/unit/kaui/base_test.rb +18 -12
  29. data/test/unit/kaui/refund_test.rb +2 -1
  30. metadata +8 -2
@@ -5,4 +5,5 @@ refund_for_pierre:
5
5
  currency: USD
6
6
  adjusted: false
7
7
  requestedDate: 2012-07-17 00:57:26
8
- effectiveDate: 2012-07-18 00:57:26
8
+ effectiveDate: 2012-07-18 00:57:26
9
+ adjustments: []
@@ -0,0 +1 @@
1
+ 11830
data/test/test_helper.rb CHANGED
@@ -14,7 +14,11 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
14
  module Kaui::KillbillHelper
15
15
  @@fixtures ||= {}
16
16
 
17
- def self.get_account(account_id, with_account_id=false)
17
+ def self.get_account_by_key_with_balance_and_cba(key)
18
+ self.get_account_by_key(key, false, true)
19
+ end
20
+
21
+ def self.get_account(account_id, with_balance = false, with_balance_and_cba = false)
18
22
  find_among_fixtures(Kaui::Account, account_id)
19
23
  end
20
24
 
@@ -22,7 +26,7 @@ module Kaui::KillbillHelper
22
26
  []
23
27
  end
24
28
 
25
- def self.get_account_by_external_key(account_id, with_account_id=false)
29
+ def self.get_account_by_external_key(account_id, with_balance = false, with_balance_and_cba = false)
26
30
  find_among_fixtures(Kaui::Account, account_id)
27
31
  end
28
32
 
@@ -24,18 +24,24 @@ class Kaui::BaseTest < ActiveSupport::TestCase
24
24
  end
25
25
 
26
26
  test "convert camelcase hash into snake case hash" do
27
- # Happy path
28
- new_hash = Kaui::Base.convert_hash_keys({:accountId=>12, :data_id=>14})
29
- assert_equal 12, new_hash[:account_id]
30
- assert_equal 14, new_hash[:data_id]
31
- assert_nil new_hash[:accountId]
32
-
33
- # Edge cases
34
- assert_nil Kaui::Base.convert_hash_keys(nil)
35
- assert_equal [], Kaui::Base.convert_hash_keys([])
36
- assert_equal Hash.new, Kaui::Base.convert_hash_keys({})
37
- assert_equal 1, Kaui::Base.convert_hash_keys(1)
38
- end
27
+ # Happy path
28
+ new_hash = Kaui::Base.convert_hash_keys({:accountId=>12, :data_id=>14})
29
+ assert_equal 12, new_hash[:account_id]
30
+ assert_equal 14, new_hash[:data_id]
31
+ assert_nil new_hash[:accountId]
32
+
33
+ # Edge cases
34
+ assert_nil Kaui::Base.convert_hash_keys(nil)
35
+ assert_equal [], Kaui::Base.convert_hash_keys([])
36
+ assert_equal Hash.new, Kaui::Base.convert_hash_keys({})
37
+ assert_equal 1, Kaui::Base.convert_hash_keys(1)
38
+ end
39
+
40
+ test "convert nested snake case into camel case" do
41
+ new_hash = Kaui::Base.camelize({:account_id=>12, :my_nested_field=> {:not_good => 32}})
42
+ assert_equal 12, new_hash[:accountId]
43
+ assert_equal 32, new_hash[:myNestedField][:notGood]
44
+ end
39
45
 
40
46
  test "can convert to money" do
41
47
  # Happy path
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class Kaui::RefundTest < ActiveSupport::TestCase
4
- fixtures :refunds
4
+ fixtures :refunds, :invoice_items
5
5
 
6
6
  test "can serialize from json" do
7
7
  as_json = refunds(:refund_for_pierre)
@@ -16,4 +16,5 @@ class Kaui::RefundTest < ActiveSupport::TestCase
16
16
  assert_equal as_json["effectiveDate"], refund.effective_date
17
17
  assert_equal as_json["adjustments"], refund.adjustments
18
18
  end
19
+
19
20
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kaui
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.11
5
+ version: 0.1.12
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alena Dudzinskaya
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-08-30 00:00:00 Z
13
+ date: 2012-09-20 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: Rails UI plugin for Killbill administration.
@@ -207,6 +207,7 @@ files:
207
207
  - test/dummy/test/fixtures/plugin_infos.yml
208
208
  - test/dummy/test/fixtures/refunds.yml
209
209
  - test/dummy/test/fixtures/tag_definitions.yml
210
+ - test/dummy/tmp/cache/assets/C8D/080/sprockets%2F4556c595251e3b8d4f688467e330da26
210
211
  - test/dummy/tmp/cache/assets/C94/4E0/sprockets%2Fea1476dc10a3348303f74d111f70441a
211
212
  - test/dummy/tmp/cache/assets/C95/690/sprockets%2Fc4b083702793f7599f4a3069c50f89a8
212
213
  - test/dummy/tmp/cache/assets/CAA/680/sprockets%2F3824d037523f650518fb22acab75559d
@@ -218,6 +219,7 @@ files:
218
219
  - test/dummy/tmp/cache/assets/CEA/300/sprockets%2Fdf2ad5c9d0990441c2bf59883383d652
219
220
  - test/dummy/tmp/cache/assets/CEC/5B0/sprockets%2F1695e8510891108e3950e2a3e4fdf9df
220
221
  - test/dummy/tmp/cache/assets/CF7/710/sprockets%2F86d43448e1fc383cb6f3d752ef288882
222
+ - test/dummy/tmp/cache/assets/CFF/A00/sprockets%2F642f58fb154eff788f45c881b294e818
221
223
  - test/dummy/tmp/cache/assets/D04/1D0/sprockets%2F3baf64d90ead2434455d2296227ba8a2
222
224
  - test/dummy/tmp/cache/assets/D05/510/sprockets%2F1c14866e2401c27b0ff5e33d1b92c4e8
223
225
  - test/dummy/tmp/cache/assets/D07/DA0/sprockets%2Ffaad9b18203975dbf0c60f3234a51874
@@ -240,6 +242,7 @@ files:
240
242
  - test/dummy/tmp/cache/assets/E20/230/sprockets%2F7d3b1348fdf74cf1b6ba2107fbbac5af
241
243
  - test/dummy/tmp/cache/assets/E22/F40/sprockets%2Faffacf2e6be325520bd3bfd2096b6dd4
242
244
  - test/dummy/tmp/cache/assets/E24/9D0/sprockets%2Fb966ab0a50fda3c156fbad4d8ab73ef6
245
+ - test/dummy/tmp/pids/server.pid
243
246
  - test/dummy/vendor/assets/images/img/glyphicons-halflings-white.png
244
247
  - test/dummy/vendor/assets/images/img/glyphicons-halflings.png
245
248
  - test/dummy/vendor/assets/javascripts/bootstrap.v2.0.4.min.js
@@ -355,6 +358,7 @@ test_files:
355
358
  - test/dummy/test/fixtures/plugin_infos.yml
356
359
  - test/dummy/test/fixtures/refunds.yml
357
360
  - test/dummy/test/fixtures/tag_definitions.yml
361
+ - test/dummy/tmp/cache/assets/C8D/080/sprockets%2F4556c595251e3b8d4f688467e330da26
358
362
  - test/dummy/tmp/cache/assets/C94/4E0/sprockets%2Fea1476dc10a3348303f74d111f70441a
359
363
  - test/dummy/tmp/cache/assets/C95/690/sprockets%2Fc4b083702793f7599f4a3069c50f89a8
360
364
  - test/dummy/tmp/cache/assets/CAA/680/sprockets%2F3824d037523f650518fb22acab75559d
@@ -366,6 +370,7 @@ test_files:
366
370
  - test/dummy/tmp/cache/assets/CEA/300/sprockets%2Fdf2ad5c9d0990441c2bf59883383d652
367
371
  - test/dummy/tmp/cache/assets/CEC/5B0/sprockets%2F1695e8510891108e3950e2a3e4fdf9df
368
372
  - test/dummy/tmp/cache/assets/CF7/710/sprockets%2F86d43448e1fc383cb6f3d752ef288882
373
+ - test/dummy/tmp/cache/assets/CFF/A00/sprockets%2F642f58fb154eff788f45c881b294e818
369
374
  - test/dummy/tmp/cache/assets/D04/1D0/sprockets%2F3baf64d90ead2434455d2296227ba8a2
370
375
  - test/dummy/tmp/cache/assets/D05/510/sprockets%2F1c14866e2401c27b0ff5e33d1b92c4e8
371
376
  - test/dummy/tmp/cache/assets/D07/DA0/sprockets%2Ffaad9b18203975dbf0c60f3234a51874
@@ -388,6 +393,7 @@ test_files:
388
393
  - test/dummy/tmp/cache/assets/E20/230/sprockets%2F7d3b1348fdf74cf1b6ba2107fbbac5af
389
394
  - test/dummy/tmp/cache/assets/E22/F40/sprockets%2Faffacf2e6be325520bd3bfd2096b6dd4
390
395
  - test/dummy/tmp/cache/assets/E24/9D0/sprockets%2Fb966ab0a50fda3c156fbad4d8ab73ef6
396
+ - test/dummy/tmp/pids/server.pid
391
397
  - test/dummy/vendor/assets/images/img/glyphicons-halflings-white.png
392
398
  - test/dummy/vendor/assets/images/img/glyphicons-halflings.png
393
399
  - test/dummy/vendor/assets/javascripts/bootstrap.v2.0.4.min.js