myfinance-rails 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/myfinance/version.rb +1 -1
- data/lib/myfinance/webhook.rb +13 -0
- data/lib/myfinance.rb +1 -0
- data/spec/features/webhooks_spec.rb +22 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5096f3fdce0ff776d195cd13f5cec9c6583d615
|
4
|
+
data.tar.gz: b4177508bbc9976362c047ee9bbc5fae236aa95c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d490ee81a0f3b14a49b23cea8e1861c7e92b8593cd1d9bb4a78230e03585991108b637c7e3abbb43f6630f7dd1ebe92ea6f2814613180979674aa91f71c74858
|
7
|
+
data.tar.gz: 2761ebc5414bc9f59f89886c5a81485c039f8d58a35b31e6379163366813dc77b72879c53b2e5ddc6e98a186471d89e16ff159164545443d3af87a89bc33bc11
|
data/lib/myfinance/version.rb
CHANGED
@@ -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
@@ -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.
|
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:
|
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
|