quanto-ruby 0.0.3 → 0.0.4

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: 50ca6459ee9dd8c1d65e57e93a8ef205b7865b73
4
- data.tar.gz: 1940e1fcbb46cf452211f1d8c9f641b1ff4c3cc7
3
+ metadata.gz: e9ba4b59823a07cbf4dfcd754d8e8668818f8427
4
+ data.tar.gz: 3ba2334cc16abeb2fa72626c45958654a57666b8
5
5
  SHA512:
6
- metadata.gz: afc149c898889d2bcc60259023a6279820a0062041562d3aab2c23acab7408d359c067ebf7fdf17ce9f8a5b341190ef2e6203dc11f512afc7d20081ad36efa07
7
- data.tar.gz: a1bae7dd41f4ec07aa577d9831fea9f9d16db2042cc6949b93730229cd7f4c85a909d76775389848978c90001e6f614ecec6f6993e3ea5544819fc713ad60501
6
+ metadata.gz: 31745e8e2c74c7e3fd342d2704ce96852728e533fc413236d7dd41aa857b4592c886790f9418735600636e09c1c9cfe6df0bcfb33ca385e66597a898c015c52f
7
+ data.tar.gz: 7f2886f2018ec7bc8557f25b325353ec6a5fde74cacdd4b9fd32b7415e00ad6e64fda3ae7b895fa88082bca6178b49651c9394dd8f39c26d72974b91c2314c41
data/lib/quanto/client.rb CHANGED
@@ -30,7 +30,8 @@ module Quanto
30
30
  end
31
31
 
32
32
  def post(path, options)
33
- access_token.post(path, options)
33
+ url = "/api/v#{API_VERSION}/#{path}"
34
+ access_token.post(url, options)
34
35
  end
35
36
 
36
37
  end
@@ -1,3 +1,3 @@
1
1
  module Quanto
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -5,9 +5,12 @@ describe Quanto::Client do
5
5
 
6
6
  let(:consumer_key) { 'consumer_key' }
7
7
  let(:consumer_secret) { 'consumer_secret' }
8
+ let(:client) { Quanto::Client.new(consumer_key, consumer_secret, options) }
8
9
 
9
10
  describe '#initialize' do
10
11
 
12
+ let(:client) { Quanto::Client.new(consumer_key, consumer_secret, options) }
13
+
11
14
  it 'constructs an OAuth2 consumer' do
12
15
  OAuth2::Client.should_receive(:new)
13
16
  Quanto::Client.new(consumer_key, consumer_secret)
@@ -29,8 +32,6 @@ describe Quanto::Client do
29
32
 
30
33
  describe '#access_token' do
31
34
 
32
- let(:client) { double('OAuth2::Client') }
33
- let(:client) { Quanto::Client.new(consumer_key, consumer_secret, options) }
34
35
 
35
36
  context 'without credentials' do
36
37
 
@@ -55,7 +56,7 @@ describe Quanto::Client do
55
56
  OAuth2::AccessToken
56
57
  .should_receive(:new)
57
58
  .with(anything, options[:access_token])
58
- client.stub(:client).and_return(double('OAuth2::Client'))
59
+ client.stub(:consumer).and_return(double('OAuth2::Client'))
59
60
  client.send(:access_token)
60
61
  end
61
62
 
@@ -63,4 +64,22 @@ describe Quanto::Client do
63
64
 
64
65
  end
65
66
 
67
+ describe '#post' do
68
+
69
+ let(:options) { { access_token: 'token' } }
70
+ let(:token) { double('OAuth2::AccessToken') }
71
+
72
+ before(:each) do
73
+ client.stub(:access_token).and_return(token)
74
+ end
75
+
76
+ it 'prepends /api/v1' do
77
+ path = 'foo'
78
+ prefix = "/api/v1/"
79
+ token.should_receive(:post).with("#{prefix}#{path}", anything)
80
+ client.send(:post, path, {})
81
+ end
82
+
83
+ end
84
+
66
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quanto-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rasmus Rygaard