myfinance-rails 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f1621ba54bf57f2b4fe5c020bec296c5b92e18b
4
- data.tar.gz: 8f8306ded00a2ef04499e79ebe9bb7b90d2e2fdc
3
+ metadata.gz: b1d0a342fa46b7fe310ab6cf6f7816987a9c7186
4
+ data.tar.gz: 19c2ba771beb72837f9b2c30f5e867a35db25347
5
5
  SHA512:
6
- metadata.gz: 303543c14f930986776e36ffd562d4f9d278d5a6b9279d44910d74d36839bbccfe574911f688f6fd490b0ca1f4e11359a943a7b6d3670d3e752066dc4decdd5a
7
- data.tar.gz: b5c6a970faf24df05595c8e5d64172e8e6c78c89d76cf628b96dc91cf8ea235504f1e5536fbb3f4c7a232a2ee1097d5fe29d3b746e6770de9f48add4be4cb1db
6
+ metadata.gz: 8473f2a1cc5aa6bdeafd6a7bc4dc890e657f70003b7b869ebf34f5247f9df9c8f99abdadc7b73530f2f0fcbab8700edff25e77e96f3990fe22435414e4f51d9e
7
+ data.tar.gz: a19152b3221b3770aa9b9e25883d32b2889147309a0d77d864c47ccb15db442e359cf741cd4311e8df929ca31d04c35a113276237012fcdad529188fc9f31d1c
@@ -42,7 +42,13 @@ module Myfinance
42
42
  end
43
43
 
44
44
  def self.classification_centers
45
- lget '/classification_centers.json'
45
+ centers = []
46
+ for page in 1..50
47
+ response = lget "/classification_centers.json?page=#{page}"
48
+ break if response.empty?
49
+ centers = centers.concat response
50
+ end
51
+ centers
46
52
  end
47
53
  end
48
54
 
@@ -0,0 +1,7 @@
1
+ module Myfinance
2
+
3
+ def self.contas_deposito(entity_id)
4
+ lget "/entities/#{entity_id}/deposit_accounts.json"
5
+ end
6
+ end
7
+
@@ -1,3 +1,3 @@
1
1
  module Myfinance
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/myfinance.rb CHANGED
@@ -7,6 +7,7 @@ require 'myfinance/imposto'
7
7
  require 'myfinance/categoria'
8
8
  require 'myfinance/centro_receita_custo'
9
9
  require 'myfinance/account'
10
+ require 'myfinance/conta_deposito'
10
11
  require 'json'
11
12
 
12
13
  module Myfinance
@@ -83,8 +83,9 @@ describe "Manipulando Centros de Receita e Custo", type: :feature do
83
83
  end
84
84
 
85
85
  it "#classification_centers" do
86
- double classification_centers_double = double("classification_centers_double")
87
- expect(Myfinance).to receive(:lget).once.with("/classification_centers.json").and_return classification_centers_double
88
- expect(Myfinance.classification_centers).to eql(classification_centers_double)
86
+ double classification_center_double = double("classification_center_double")
87
+ expect(Myfinance).to receive(:lget).once.with("/classification_centers.json?page=1").and_return [classification_center_double]
88
+ expect(Myfinance).to receive(:lget).once.with("/classification_centers.json?page=2").and_return []
89
+ expect(Myfinance.classification_centers).to eql([classification_center_double])
89
90
  end
90
91
  end
@@ -0,0 +1,10 @@
1
+ describe 'Manipulando Contas de Depósito', type: :feature do
2
+
3
+ require 'myfinance'
4
+
5
+ it '#contas_deposito' do
6
+ double contas_deposito_double = double("contas_deposito")
7
+ expect(Myfinance).to receive(:lget).once.with("/entities/1/deposit_accounts.json").and_return contas_deposito_double
8
+ expect(Myfinance.contas_deposito(1)).to eql(contas_deposito_double)
9
+ end
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myfinance-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Lopes Neto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,6 +86,7 @@ files:
86
86
  - lib/myfinance/centro_receita_custo.rb
87
87
  - lib/myfinance/conta_a_pagar.rb
88
88
  - lib/myfinance/conta_a_receber.rb
89
+ - lib/myfinance/conta_deposito.rb
89
90
  - lib/myfinance/entidade.rb
90
91
  - lib/myfinance/imposto.rb
91
92
  - lib/myfinance/pessoa.rb
@@ -94,6 +95,7 @@ files:
94
95
  - spec/features/account_spec.rb
95
96
  - spec/features/categoria_spec.rb
96
97
  - spec/features/centro_receita_custo_spec.rb
98
+ - spec/features/conta_deposito_spec.rb
97
99
  - spec/features/contas_a_receber_spec.rb
98
100
  - spec/features/entidades_spec.rb
99
101
  - spec/features/imposto_spec.rb
@@ -127,6 +129,7 @@ test_files:
127
129
  - spec/features/account_spec.rb
128
130
  - spec/features/categoria_spec.rb
129
131
  - spec/features/centro_receita_custo_spec.rb
132
+ - spec/features/conta_deposito_spec.rb
130
133
  - spec/features/contas_a_receber_spec.rb
131
134
  - spec/features/entidades_spec.rb
132
135
  - spec/features/imposto_spec.rb