totter 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,6 +14,17 @@ module Totter
14
14
  get("users/#{user_id}/decisions/#{decision_id}/choices/#{choice_id}").body
15
15
  end
16
16
 
17
+ # Gets votes on a single choice bucketed into authed and invited votes
18
+ #
19
+ # @param user_id [Numeric] The choice's decision's user id
20
+ # @param decision_id [Numeric] The choice's decision's id
21
+ # @param choice_id [Numeric] The choice's id
22
+ # @return [Hashie::Mash]
23
+ # @example
24
+ # Totter.choice_votes(1, 1, 1)
25
+ def choice_votes(user_id, decision_id, choice_id)
26
+ get("users/#{user_id}/decisions/#{decision_id}/choices/#{choice_id}/votes").body
27
+ end
17
28
 
18
29
  # Create a new choice using a supplied image url
19
30
  #
@@ -1,4 +1,4 @@
1
1
  module Totter
2
2
  # Verion of the Totter gem
3
- VERSION = '0.3.8'
3
+ VERSION = '0.3.9'
4
4
  end
@@ -27,6 +27,11 @@ class ChoicesTest < Totter::TestCase
27
27
  end
28
28
  end
29
29
 
30
+ def test_choice_votes
31
+ stub_request(:get, 'http://localhost:5000/v1/users/1/decisions/1/choices/1/votes').to_return(:status => 200, :body => "[]")
32
+ assert_equal [], local_client.choice_votes(1, 1, 1)
33
+ end
34
+
30
35
  def test_create_choice_upload
31
36
  VCR.use_cassette 'choices/create_choice_upload' do
32
37
  client = local_client
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-04-11 00:00:00.000000000 Z
14
+ date: 2013-04-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json
@@ -156,6 +156,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - - ! '>='
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
+ segments:
160
+ - 0
161
+ hash: -1950669833506762160
159
162
  requirements: []
160
163
  rubyforge_project:
161
164
  rubygems_version: 1.8.23