Permalink
Browse files

Add test for single member

  • Loading branch information...
1 parent 6f4a008 commit f0e3ae8773a439f570b004fec71fed53fb094334 @czarneckid czarneckid committed Oct 12, 2012
Showing with 8 additions and 0 deletions.
  1. +4 −0 spec/leaderboard_spec.rb
  2. +4 −0 spec/reverse_leaderboard_spec.rb
View
@@ -628,6 +628,10 @@
members[0][:score].to_i.should be(21)
members[4][:member].should eql('member_17')
+ members = @leaderboard.members_from_rank_range(1, 1)
+ members.size.should be(1)
+ members[0][:member].should eql('member_25')
+
members = @leaderboard.members_from_rank_range(-1, 26)
members.size.should be(25)
members[0][:member].should eql('member_25')
@@ -344,6 +344,10 @@
members[0][:score].to_i.should be(5)
members[4][:member].should eql('member_9')
+ members = @leaderboard.members_from_rank_range(1, 1)
+ members.size.should be(1)
+ members[0][:member].should eql('member_1')
+
members = @leaderboard.members_from_rank_range(-1, 26)
members.size.should be(25)
members[0][:member].should eql('member_1')

0 comments on commit f0e3ae8

Please sign in to comment.