totter 0.3.9 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ module Totter
16
16
  # @example
17
17
  # Totter.activity(1)
18
18
  def activities(user_id, options = DEFAULT_ACTIVITY_OPTIONS)
19
- get("users/#{user_id}/activities").body
19
+ get("users/#{user_id}/activities?limit=#{options[:limit]}&offset=#{options[:offset]}").body
20
20
  end
21
21
 
22
22
  # Returns activities performed on a given user
@@ -26,8 +26,8 @@ module Totter
26
26
  # @return [Hashie::Mash]
27
27
  # @example
28
28
  # Totter.activity(1)
29
- def my_activities(user_id, options = DEFAULT_ACTIVITY_OPTIONS)
30
- get("users/#{user_id}/activities/me").body
29
+ def my_activities(options = DEFAULT_ACTIVITY_OPTIONS)
30
+ get("me/activities?limit=#{options[:limit]}&offset=#{options[:offset]}").body
31
31
  end
32
32
 
33
33
  # Returns activities performed by a user's friends
@@ -37,8 +37,8 @@ module Totter
37
37
  # @return [Hashie::Mash]
38
38
  # @example
39
39
  # Totter.activity(1)
40
- def friends_activities(user_id, options = DEFAULT_ACTIVITY_OPTIONS)
41
- get("users/#{user_id}/activities/friends").body
40
+ def friends_activities(options = DEFAULT_ACTIVITY_OPTIONS)
41
+ get("me/activities/friends?limit=#{options[:limit]}&offset=#{options[:offset]}").body
42
42
  end
43
43
 
44
44
  end
@@ -1,4 +1,4 @@
1
1
  module Totter
2
2
  # Verion of the Totter gem
3
- VERSION = '0.3.9'
3
+ VERSION = '0.4.0'
4
4
  end
@@ -2,20 +2,20 @@ require 'test_helper'
2
2
 
3
3
  class ActivitiesTest < Totter::TestCase
4
4
  def test_activity
5
- stub_request(:get, 'http://localhost:5000/v1/users/4/activities').to_return(:status => 200, :body => "[]")
5
+ stub_request(:get, 'http://localhost:5000/v1/users/4/activities?limit=50&offset=0').to_return(:status => 200, :body => "[]")
6
6
  result = local_client.activities(4)
7
7
  assert_equal 0, result.length
8
8
  end
9
9
 
10
10
  def test_my_activity
11
- stub_request(:get, 'http://localhost:5000/v1/users/4/activities/me').to_return(:status => 200, :body => "[]")
12
- result = local_client.my_activities(4)
11
+ stub_request(:get, 'http://localhost:5000/v1/me/activities?limit=50&offset=0').to_return(:status => 200, :body => "[]")
12
+ result = local_client.my_activities
13
13
  assert_equal 0, result.length
14
14
  end
15
15
 
16
16
  def test_friends_activity
17
- stub_request(:get, 'http://localhost:5000/v1/users/4/activities/friends').to_return(:status => 200, :body => "[]")
18
- result = local_client.friends_activities(4)
17
+ stub_request(:get, 'http://localhost:5000/v1/me/activities/friends?limit=50&offset=0').to_return(:status => 200, :body => "[]")
18
+ result = local_client.friends_activities
19
19
  assert_equal 0, result.length
20
20
  end
21
21
  end
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.9
4
+ version: 0.4.0
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-29 00:00:00.000000000 Z
14
+ date: 2013-05-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json
@@ -156,9 +156,6 @@ 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
162
159
  requirements: []
163
160
  rubyforge_project:
164
161
  rubygems_version: 1.8.23