myfinance-rails 0.3.0 → 0.4.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: 57f5cd588cb00d27f3279925bcc6bea51f3683d5
4
- data.tar.gz: 96f9b46ff5c211bd685aa0795193548002f3a52b
3
+ metadata.gz: a5096f3fdce0ff776d195cd13f5cec9c6583d615
4
+ data.tar.gz: b4177508bbc9976362c047ee9bbc5fae236aa95c
5
5
  SHA512:
6
- metadata.gz: 061902573778b544bd25f99cd21970bacb16def8e6083a8593e680e86dbe6502d6513903ed34ce6db1e3225dfcaaf319c7739a41aef64f631f95bc473e950240
7
- data.tar.gz: 5b614f64b5cb5856f7e18dc6f30d432ed7e70064588cb569cf8802346714a8600ab7610a5619a59efc4e6260b21d2efa8a9fc55cc19c8f0791ecc1658e3b5f82
6
+ metadata.gz: d490ee81a0f3b14a49b23cea8e1861c7e92b8593cd1d9bb4a78230e03585991108b637c7e3abbb43f6630f7dd1ebe92ea6f2814613180979674aa91f71c74858
7
+ data.tar.gz: 2761ebc5414bc9f59f89886c5a81485c039f8d58a35b31e6379163366813dc77b72879c53b2e5ddc6e98a186471d89e16ff159164545443d3af87a89bc33bc11
@@ -1,3 +1,3 @@
1
1
  module Myfinance
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -0,0 +1,13 @@
1
+ module Myfinance
2
+ def self.cria_webhook(webhook)
3
+ lpost "/integrations/webhooks.json", webhook
4
+ end
5
+
6
+ def self.webhooks
7
+ lget "/integrations/webhooks.json"
8
+ end
9
+
10
+ def self.apaga_webhook(id)
11
+ ldelete "/integrations/webhooks/#{id}.json"
12
+ end
13
+ end
data/lib/myfinance.rb CHANGED
@@ -8,6 +8,7 @@ require 'myfinance/categoria'
8
8
  require 'myfinance/centro_receita_custo'
9
9
  require 'myfinance/account'
10
10
  require 'myfinance/conta_deposito'
11
+ require 'myfinance/webhook'
11
12
  require 'json'
12
13
 
13
14
  module Myfinance
@@ -0,0 +1,22 @@
1
+ require 'myfinance'
2
+
3
+ describe 'Manipulando Webhooks', type: :feature do
4
+ it "#cria_webhook" do
5
+ webhook_double = double("webhook")
6
+ new_webhook = double("new_webhook")
7
+ expect(Myfinance).to receive(:lpost).with("/integrations/webhooks.json", webhook_double).and_return new_webhook
8
+ expect(Myfinance.cria_webhook(webhook_double)).to eql new_webhook
9
+ end
10
+
11
+ it "#webhooks" do
12
+ webhooks_double = double("webhooks")
13
+ expect(Myfinance).to receive(:lget).with("/integrations/webhooks.json").and_return webhooks_double
14
+ expect(Myfinance.webhooks).to eql webhooks_double
15
+ end
16
+
17
+ it "#apaga_webhook" do
18
+ webhook_double = double('webhook')
19
+ expect(Myfinance).to receive(:ldelete).once.with("/integrations/webhooks/1.json").and_return webhook_double
20
+ expect(Myfinance.apaga_webhook(1)).to eql webhook_double
21
+ end
22
+ 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.3.0
4
+ version: 0.4.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-12-27 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,6 +91,7 @@ files:
91
91
  - lib/myfinance/imposto.rb
92
92
  - lib/myfinance/pessoa.rb
93
93
  - lib/myfinance/version.rb
94
+ - lib/myfinance/webhook.rb
94
95
  - myfinance-rails.gemspec
95
96
  - spec/features/account_spec.rb
96
97
  - spec/features/categoria_spec.rb
@@ -100,6 +101,7 @@ files:
100
101
  - spec/features/entidades_spec.rb
101
102
  - spec/features/imposto_spec.rb
102
103
  - spec/features/pessoas_spec.rb
104
+ - spec/features/webhooks_spec.rb
103
105
  - spec/spec_helper.rb
104
106
  homepage: ''
105
107
  licenses:
@@ -134,4 +136,5 @@ test_files:
134
136
  - spec/features/entidades_spec.rb
135
137
  - spec/features/imposto_spec.rb
136
138
  - spec/features/pessoas_spec.rb
139
+ - spec/features/webhooks_spec.rb
137
140
  - spec/spec_helper.rb