myfinance-rails 0.0.11 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/myfinance.rb +10 -0
- data/lib/myfinance/conta_a_receber.rb +6 -1
- data/lib/myfinance/version.rb +1 -1
- data/spec/features/contas_a_receber_spec.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ce11a33b8bdb6a47fc804d5164d84ef0d34d5f9
|
4
|
+
data.tar.gz: 80e4f5f46b85dd5a1424611631e67769b0b8288b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814f92a8d01dfb82ff6732c327514069eeef0be3d1999676d9bc591298b13bfdd50e273930907e5bf9eea6e5c35d153310117647c9c4562e55644c0c44d41e52
|
7
|
+
data.tar.gz: ab2ccda7aa896b905bd72fed66bda8c55583238b9f5ba81eb79a2f61326adfb15d22995b2bc800aaab0d23a34f5deb9275eb2517467cf64abd2909cdc6959a4e
|
data/lib/myfinance.rb
CHANGED
@@ -65,6 +65,16 @@ module Myfinance
|
|
65
65
|
response
|
66
66
|
end
|
67
67
|
|
68
|
+
def self.ldelete(url)
|
69
|
+
options = {
|
70
|
+
:basic_auth => {:username => @token, :password => 'x'},
|
71
|
+
:headers => { 'Content-Type' => 'application/json' }
|
72
|
+
}
|
73
|
+
add_account_id options
|
74
|
+
response = delete url, options
|
75
|
+
response
|
76
|
+
end
|
77
|
+
|
68
78
|
def self.format_time(dt)
|
69
79
|
dt.strftime('%FT%H:%MZ') rescue nil
|
70
80
|
end
|
@@ -17,6 +17,11 @@ module Myfinance
|
|
17
17
|
lget "/entities/#{entity_id}/receivable_accounts/#{id}.json"
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.apaga_conta_a_receber(id, entity_id)
|
21
|
+
ldelete "/entities/#{entity_id}/receivable_accounts/#{id}.json"
|
22
|
+
end
|
20
23
|
|
24
|
+
def self.altera_conta_a_receber(id, entity_id, faturamento)
|
25
|
+
lput "/entities/#{entity_id}/receivable_accounts/#{id}.json", faturamento
|
26
|
+
end
|
21
27
|
end
|
22
|
-
|
data/lib/myfinance/version.rb
CHANGED
@@ -64,8 +64,21 @@ describe 'Manipulando Contas a Receber', type: :feature do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it '#conta_a_receber' do
|
67
|
-
double conta_a_receber_double = double('
|
67
|
+
double conta_a_receber_double = double('conta_a_receber')
|
68
68
|
expect(Myfinance).to receive(:lget).once.with("/entities/2/receivable_accounts/1.json").and_return conta_a_receber_double
|
69
69
|
expect(Myfinance.conta_a_receber(1,2)).to eql(conta_a_receber_double)
|
70
70
|
end
|
71
|
+
|
72
|
+
it "#apaga_conta_a_receber" do
|
73
|
+
double conta_a_receber_double = double('conta_a_receber')
|
74
|
+
expect(Myfinance).to receive(:ldelete).once.with("/entities/2/receivable_accounts/1.json").and_return conta_a_receber_double
|
75
|
+
expect(Myfinance.apaga_conta_a_receber(1, 2)).to eql(conta_a_receber_double)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "#altera_conta_a_receber" do
|
79
|
+
double conta_a_receber_parameters_double = double('conta_a_receber_parameters')
|
80
|
+
double conta_a_receber_double = double('conta_a_receber')
|
81
|
+
expect(Myfinance).to receive(:lput).once.with("/entities/2/receivable_accounts/1.json", conta_a_receber_parameters_double).and_return conta_a_receber_double
|
82
|
+
expect(Myfinance.altera_conta_a_receber(1, 2, conta_a_receber_parameters_double)).to eql(conta_a_receber_double)
|
83
|
+
end
|
71
84
|
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.0.
|
4
|
+
version: 0.0.13
|
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-01-
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|