billing 0.1.3 → 0.1.4
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/app/jobs/billing/issue_print_doc.rb +3 -0
- data/app/models/billing/payment_with_type.rb +1 -1
- data/db/migrate/20170329013520_add_custom_commands_to_billing_receipt_config.rb +6 -0
- data/lib/billing/version.rb +1 -1
- data/test/dummy/config/environments/production.rb +1 -1
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +93 -76
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +5407 -0
- data/test/dummy/log/test.log +10487 -0
- data/test/models/billing/bill_test.rb +5 -5
- data/test/models/billing/charge_test.rb +6 -6
- metadata +3 -2
|
@@ -9,12 +9,12 @@ module Billing
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
test "summaries" do
|
|
12
|
-
assert_equal '
|
|
13
|
-
assert_equal '
|
|
12
|
+
assert_equal '3 USD'.to_money, @bill.charges_sum
|
|
13
|
+
assert_equal '3 USD'.to_money, @bill.surcharges_sum
|
|
14
14
|
assert_equal '0 USD'.to_money, @bill.discounts_sum
|
|
15
15
|
assert_equal '3 USD'.to_money, @bill.payments_sum
|
|
16
|
-
assert_equal '
|
|
17
|
-
assert_equal '-
|
|
16
|
+
assert_equal '6 USD'.to_money, @bill.total
|
|
17
|
+
assert_equal '-3 USD'.to_money, @bill.balance
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
test "charge" do
|
|
@@ -23,7 +23,7 @@ module Billing
|
|
|
23
23
|
assert @bill.save!
|
|
24
24
|
end
|
|
25
25
|
assert charge.persisted?
|
|
26
|
-
assert_equal '
|
|
26
|
+
assert_equal '12 USD'.to_money, @bill.total
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
test "discount" do
|
|
@@ -7,15 +7,15 @@ module Billing
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
test "wild class method" do
|
|
10
|
-
assert_equal Billing::Charge.new(Billing::Charge.
|
|
11
|
-
assert_equal Billing::Charge.new(Billing::Charge.
|
|
12
|
-
assert_equal Billing::Charge.new(Billing::Charge.
|
|
13
|
-
assert_equal Billing::Charge.new(Billing::Charge.
|
|
14
|
-
assert_equal Billing::Charge.new(Billing::Charge.
|
|
10
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild_args(1)).price, '1 USD'.to_money
|
|
11
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild_args("1")).price, '1 USD'.to_money
|
|
12
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild_args("1EUR")).price, '1 EUR'.to_money
|
|
13
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild_args('1', price_currency: 'EUR')).price, '1 EUR'.to_money
|
|
14
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild_args(price: 10, price_currency: 'EUR')).price, '10 EUR'.to_money
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
test "string protocol" do
|
|
18
|
-
charge = Billing::Charge.new Billing::Charge.
|
|
18
|
+
charge = Billing::Charge.new Billing::Charge.wild_args("2.5*3.5##{billing_plus(:one).id}@#{billing_tax_groups(:one).id}+1.5%/Umbrella")
|
|
19
19
|
assert_equal charge.price, '3.5 USD'.to_money
|
|
20
20
|
assert_equal charge.name, 'Umbrella'
|
|
21
21
|
#p charge
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: billing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Vangelov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -182,6 +182,7 @@ files:
|
|
|
182
182
|
- db/migrate/20160828145106_create_billing_receipt_configs.rb
|
|
183
183
|
- db/migrate/20160828145448_add_receipt_config_to_billing_origin.rb
|
|
184
184
|
- db/migrate/20160831231640_add_paper_cut_to_billing_receipt_config.rb
|
|
185
|
+
- db/migrate/20170329013520_add_custom_commands_to_billing_receipt_config.rb
|
|
185
186
|
- lib/billing.rb
|
|
186
187
|
- lib/billing/billable.rb
|
|
187
188
|
- lib/billing/engine.rb
|