Permalink
Browse files

append category property

  • Loading branch information...
1 parent 87d8911 commit a7c1cd0d78ac50f6799211ef54801332c154a24a @carlosvillu carlosvillu committed Jan 27, 2012
Showing with 11 additions and 1 deletion.
  1. +2 −1 lib/parser.js
  2. +1 −0 src/parser.coffee
  3. +8 −0 test/parser.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -14,6 +14,7 @@ getOperationFromHTML = (tr) ->
description: $(tr).find('td').eq(2).html()
amount: parseFloat(amountValue.replace(',', '.'), 10) #replace decimal comma for point
balance: parseFloat(balanceValue.replace(',', '.'), 10) #replace decimal comma for point
+ category: 'undefined'
module.exports = (path, cb) ->
exists path, (exists) ->
View
@@ -56,6 +56,12 @@ describe 'Parser', ->
movement.should.have.property 'balance' for movement in movements
done()
+ it 'each object should has the key category', (done) ->
+ parser pathToFixture, (err, movements) ->
+ done(err) if err
+ movement.should.have.property 'category' for movement in movements
+ done()
+
it 'the data_operation field should be a Date type', (done) ->
parser pathToFixture, (err, movements) ->
done(err) if err
@@ -91,12 +97,14 @@ describe 'Parser', ->
description: "Ingreso N�mina"
amount: 3675.7
balance: 3424.63
+ category: 'undefined'
@expectedThree =
date_operation: new Date(2011, 11, 27)
date_valor: new Date(2011, 11, 27)
description: "Pago PELUQUERIA"
amount: -9
balance: 3390.26
+ category: 'undefined'
it 'should be 4 operations', (done) ->
parser pathToFixture, (err, movements) ->

0 comments on commit a7c1cd0

Please sign in to comment.