uomi 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/lib/uomi/late_payment.rb +0 -1
- data/lib/uomi/line_item.rb +1 -1
- data/lib/uomi/line_item_type.rb +0 -1
- data/lib/uomi/version.rb +1 -1
- data/spec/lib/uomi/credit_note_spec.rb +0 -3
- data/spec/lib/uomi/invoice_adjustment_spec.rb +0 -3
- data/spec/lib/uomi/invoice_spec.rb +8 -11
- data/spec/lib/uomi/line_item_spec.rb +2 -3
- data/spec/lib/uomi/overdue_invoice_spec.rb +0 -5
- data/spec/spec_helper.rb +10 -7
- data/uomi.gemspec +2 -1
- metadata +19 -7
- data/spec/lib/uomi/invoice_late_payment_spec.rb +0 -10
- data/spec/support/helpers.rb +0 -20
data/Gemfile
CHANGED
data/README.md
CHANGED
data/lib/uomi/late_payment.rb
CHANGED
data/lib/uomi/line_item.rb
CHANGED
data/lib/uomi/line_item_type.rb
CHANGED
data/lib/uomi/version.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Uomi::Invoice do
|
4
|
-
include Helpers
|
5
4
|
|
6
5
|
before(:each) do
|
7
|
-
tear_it_down
|
8
|
-
|
9
6
|
@invoice = Uomi::generate_invoice do
|
10
7
|
line_item description: "Line Item 1", amount: 1101, line_item_type_id: 1
|
11
8
|
line_item description: "Line Item 2", amount: 5097, line_item_type_id: 1
|
@@ -76,10 +73,6 @@ describe Uomi::Invoice do
|
|
76
73
|
|
77
74
|
context "searching for sets of invoices" do
|
78
75
|
|
79
|
-
before(:each) do
|
80
|
-
tear_it_down
|
81
|
-
end
|
82
|
-
|
83
76
|
it "should find draft invoices" do
|
84
77
|
issued_invoice = Uomi::generate_invoice do
|
85
78
|
line_item description: "Line Item 1", amount: 1101, line_item_type_id: 1
|
@@ -91,8 +84,8 @@ describe Uomi::Invoice do
|
|
91
84
|
line_item description: "Line Item 1", amount: 1101, line_item_type_id: 1, line_item_type_id: 1
|
92
85
|
end
|
93
86
|
|
94
|
-
Uomi::Invoice.draft.count.should ==
|
95
|
-
Uomi::Invoice.draft.
|
87
|
+
Uomi::Invoice.draft.count.should == 2
|
88
|
+
Uomi::Invoice.draft.last.should == draft_invoice
|
96
89
|
end
|
97
90
|
|
98
91
|
it "should find issued invoices" do
|
@@ -385,6 +378,7 @@ describe Uomi::Invoice do
|
|
385
378
|
end
|
386
379
|
|
387
380
|
context "Hooks" do
|
381
|
+
|
388
382
|
before(:each) do
|
389
383
|
item_to_invoice = @invoice.extend(Uomi::Invoiceable)
|
390
384
|
item_to_invoice.amount = 10
|
@@ -397,18 +391,21 @@ describe Uomi::Invoice do
|
|
397
391
|
end
|
398
392
|
|
399
393
|
context "issuing the invoice" do
|
400
|
-
|
394
|
+
|
395
|
+
it "calls mark_invoiced on each invoiced item" do
|
401
396
|
@item_to_invoice.should_receive(:mark_invoiced).with(@invoice2)
|
402
397
|
@invoice2.issue!
|
403
398
|
end
|
399
|
+
|
404
400
|
end
|
405
401
|
|
406
402
|
context "voiding the issued invoice" do
|
403
|
+
|
407
404
|
before(:each) do
|
408
405
|
@invoice2.issue!
|
409
406
|
end
|
410
407
|
|
411
|
-
it "
|
408
|
+
it "calls mark_uninvoiced on each invoiced item" do
|
412
409
|
@item_to_invoice.should_receive(:mark_uninvoiced).with(@invoice2)
|
413
410
|
@invoice2.void!
|
414
411
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Uomi::LineItem do
|
4
|
-
include Helpers
|
5
4
|
|
6
|
-
it "should validate that the amount is
|
7
|
-
expect {Uomi::LineItem.create! amount:
|
5
|
+
it "should validate that the amount is numeric" do
|
6
|
+
expect {Uomi::LineItem.create! amount: "fifty bucks"}.to raise_error ActiveRecord::RecordInvalid, "Validation failed: Amount is not a number"
|
8
7
|
end
|
9
8
|
|
10
9
|
it "should validate that the amount is specified" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require 'rubygems'
|
3
2
|
require 'bundler'
|
4
3
|
|
@@ -8,13 +7,17 @@ Combustion.initialize! :active_record
|
|
8
7
|
|
9
8
|
require 'rspec/rails'
|
10
9
|
|
11
|
-
require './spec/support/helpers.rb'
|
12
|
-
|
13
10
|
RSpec.configure do |config|
|
14
11
|
config.use_transactional_fixtures = true
|
15
12
|
config.color_enabled = true
|
16
|
-
config.formatter = :documentation
|
17
|
-
#config.include FactoryGirl::Syntax::Methods
|
18
|
-
end
|
13
|
+
config.formatter = :documentation
|
19
14
|
|
20
|
-
|
15
|
+
config.before(:suite) do
|
16
|
+
DatabaseCleaner.strategy = :truncation
|
17
|
+
end
|
18
|
+
|
19
|
+
config.before(:each) do
|
20
|
+
DatabaseCleaner.clean
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/uomi.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Uomi::VERSION
|
8
8
|
s.authors = ["Douglas Anderson", "Jeffrey van Aswegen"]
|
9
9
|
s.email = ["i.am.douglas.anderson@gmail.com", "jeffmess@gmail.com"]
|
10
|
-
s.homepage = 'https://github.com/tehtorq/
|
10
|
+
s.homepage = 'https://github.com/tehtorq/invoicing'
|
11
11
|
s.summary = %q{ An uomi gem. }
|
12
12
|
s.description = %q{ Manage invoices. }
|
13
13
|
|
@@ -24,4 +24,5 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency "workflow", '= 0.8.7'
|
25
25
|
|
26
26
|
s.add_development_dependency 'combustion', '~> 0.3.1'
|
27
|
+
s.add_development_dependency 'database_cleaner', '~> 1.2.0'
|
27
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uomi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.15
|
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:
|
13
|
+
date: 2014-04-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -92,6 +92,22 @@ dependencies:
|
|
92
92
|
- - ~>
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 0.3.1
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: database_cleaner
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.2.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.2.0
|
95
111
|
description: ! ' Manage invoices. '
|
96
112
|
email:
|
97
113
|
- i.am.douglas.anderson@gmail.com
|
@@ -137,14 +153,12 @@ files:
|
|
137
153
|
- spec/internal/public/favicon.ico
|
138
154
|
- spec/lib/uomi/credit_note_spec.rb
|
139
155
|
- spec/lib/uomi/invoice_adjustment_spec.rb
|
140
|
-
- spec/lib/uomi/invoice_late_payment_spec.rb
|
141
156
|
- spec/lib/uomi/invoice_spec.rb
|
142
157
|
- spec/lib/uomi/line_item_spec.rb
|
143
158
|
- spec/lib/uomi/overdue_invoice_spec.rb
|
144
159
|
- spec/spec_helper.rb
|
145
|
-
- spec/support/helpers.rb
|
146
160
|
- uomi.gemspec
|
147
|
-
homepage: https://github.com/tehtorq/
|
161
|
+
homepage: https://github.com/tehtorq/invoicing
|
148
162
|
licenses: []
|
149
163
|
post_install_message:
|
150
164
|
rdoc_options: []
|
@@ -177,9 +191,7 @@ test_files:
|
|
177
191
|
- spec/internal/public/favicon.ico
|
178
192
|
- spec/lib/uomi/credit_note_spec.rb
|
179
193
|
- spec/lib/uomi/invoice_adjustment_spec.rb
|
180
|
-
- spec/lib/uomi/invoice_late_payment_spec.rb
|
181
194
|
- spec/lib/uomi/invoice_spec.rb
|
182
195
|
- spec/lib/uomi/line_item_spec.rb
|
183
196
|
- spec/lib/uomi/overdue_invoice_spec.rb
|
184
197
|
- spec/spec_helper.rb
|
185
|
-
- spec/support/helpers.rb
|
data/spec/support/helpers.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module Helpers
|
2
|
-
def tear_it_down
|
3
|
-
Uomi::Invoice.delete_all
|
4
|
-
Uomi::LineItem.delete_all
|
5
|
-
Uomi::Transaction.delete_all
|
6
|
-
Uomi::LatePayment.delete_all
|
7
|
-
Uomi::PaymentReference.delete_all
|
8
|
-
Uomi::Seller.delete_all
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|