foursquare2 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_users.rb CHANGED
@@ -73,5 +73,27 @@ class TestUsers < Test::Unit::TestCase
73
73
  mayorships = @client.user_mayorships('self')
74
74
  mayorships.items.size.should == 2
75
75
  end
76
+
77
+ should "find a users checkins - plain (without optional params)" do
78
+ stub_get("https://api.foursquare.com/v2/users/self/checkins?oauth_token=#{@client.oauth_token}", "users/user_checkins_plain.json")
79
+ checkins = @client.user_checkins
80
+ checkins.items.size.should == 20
81
+ end
82
+
83
+ should "find a users checkins with afterTimestamp param" do
84
+ stub_get("https://api.foursquare.com/v2/users/self/checkins?oauth_token=#{@client.oauth_token}&limit=10&offset=2&sort=newestfirst&afterTimestamp=1279044824", "users/user_checkins_aftertimestamp.json")
85
+ checkins_after = @client.user_checkins({:limit => 10, :offset => 2, :sort => 'newestfirst', :afterTimestamp => 1279044824})
86
+ checkins_after.items.size.should == 10
87
+ checkins_after.items.reject { |ci| ci.createdAt > 1279044824 }.empty?.should == true
88
+ checkins_after.items.first.createdAt.should > checkins_after.items.last.createdAt
89
+ end
90
+
91
+ should "should find a users checkins with beforeTimestamp param" do
92
+ stub_get("https://api.foursquare.com/v2/users/self/checkins?oauth_token=#{@client.oauth_token}&limit=5&offset=20&sort=oldestfirst&beforeTimestamp=1355867689", "users/user_checkins_beforetimestamp.json")
93
+ checkins_before = @client.user_checkins({:limit => 5, :offset => 20, :sort => 'oldestfirst', :beforeTimestamp => 1355867689})
94
+ checkins_before.items.size.should == 5
95
+ checkins_before.items.reject { |ci| ci.createdAt < 1355867689 }.empty?.should == true
96
+ checkins_before.items.first.createdAt.should < checkins_before.items.last.createdAt
97
+ end
76
98
  end
77
99
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foursquare2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-10 00:00:00.000000000 Z
13
+ date: 2012-12-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -270,6 +270,9 @@ files:
270
270
  - test/fixtures/users/leaderboard.json
271
271
  - test/fixtures/users/search_users.json
272
272
  - test/fixtures/users/user.json
273
+ - test/fixtures/users/user_checkins_aftertimestamp.json
274
+ - test/fixtures/users/user_checkins_beforetimestamp.json
275
+ - test/fixtures/users/user_checkins_plain.json
273
276
  - test/fixtures/users/user_lists.json
274
277
  - test/fixtures/users/user_mayorships.json
275
278
  - test/fixtures/users/user_tips.json
@@ -312,7 +315,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
312
315
  version: '0'
313
316
  segments:
314
317
  - 0
315
- hash: -1147232695662133352
318
+ hash: 2718760689683095766
316
319
  required_rubygems_version: !ruby/object:Gem::Requirement
317
320
  none: false
318
321
  requirements: