vpsa 0.0.7 → 0.0.8

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: 7b4ad9ceb624244e09b367ecf51d5ea9781297f3
4
- data.tar.gz: eaadaa028010f6c8504ccfa73c8d4117198c5f73
3
+ metadata.gz: b6eb04dae2d75343bbc1a8e358bfddb6e8e23b6c
4
+ data.tar.gz: 87e5385337d27af96f20df30ab22c34721ad9d0c
5
5
  SHA512:
6
- metadata.gz: 2c9899a7bed43740f77f3257315527961deb4334d51a943f729c402b762354ecadf397ad3624f26038c805e6ce0d164cf5333ac7a0f437c93118fc411353e121
7
- data.tar.gz: deeb1fd792502ce1a08ebd2d9a3cccd83aa9fc2a7239d75beeae71b745c44779ed8be3b8f339ccaa4da0f76a9b89d2f986fd579fdae9fd517fce5d4a9fd6cce2
6
+ metadata.gz: 2669691e066a6d5b09807634ce11d00e9c34d584a284550e6edd7c63bdcc64599354c507a0f399ccfa4add0564d1ddf6cd16d352787a9c96986da5d9565f7801
7
+ data.tar.gz: b14635a7c8b38c4463a6821ae4eb49cf8418f994f1be8081ff77bc7ab0a39f14ff206052cda7f3139d42d19d12e877ecc4181a229dcd35d23ffc4bffaefc2c5d
@@ -43,8 +43,8 @@ module Vpsa
43
43
  return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", :body => build_body({"justificativa" => justification}), :headers => header))
44
44
  end
45
45
 
46
- def credit_limit_history(id)
47
- return parse_response(self.class.get("/#{id}/limites_credito/historico", :body => build_body, :headers => header))
46
+ def credit_limit_history(id, start_date, end_date)
47
+ return parse_response(self.class.get("/#{id}/limites_credito/historico", :body => build_body({"desde" => start_date, "ate" => end_date}), :headers => header))
48
48
  end
49
49
  end
50
50
  end
data/lib/vpsa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vpsa
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -158,14 +158,16 @@ RSpec.describe Vpsa::Api::ThirdParties do
158
158
  end
159
159
 
160
160
  context "history" do
161
+ let(:history_params) {{"desde" => Date.parse("01/01/2015"), "ate" => Date.parse("11/01/2015"), :token => "abc"}}
162
+
161
163
  before(:each) do
162
164
  stub_request(:get, "https://www.vpsa.com.br/apps/api/terceiros/5/limites_credito/historico").to_return(:status => 200)
163
165
  end
164
166
 
165
167
  it "should issue a get to the third party credit history url" do
166
- expect(Vpsa::Api::ThirdParties).to receive(:get).with("/5/limites_credito/historico", :body => {:token => "abc"}.to_json, :headers => header).and_call_original
168
+ expect(Vpsa::Api::ThirdParties).to receive(:get).with("/5/limites_credito/historico", :body => history_params.to_json, :headers => header).and_call_original
167
169
 
168
- Vpsa.new("abc").third_parties.credit_limit_history(5)
170
+ Vpsa.new("abc").third_parties.credit_limit_history(5, Date.parse("01/01/2015"), Date.parse("11/01/2015"))
169
171
  end
170
172
  end
171
173
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpsa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Berdugo