Skip to content

Commit

Permalink
Tests added for pagination on followers/following
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Mar 24, 2011
1 parent 6d31090 commit 7f7c26a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/rstatus_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,44 @@ def test_user_unfollow_another_user
assert_match "No longer following #{u2.username}", page.body
end

def test_user_following_paginates
u = Factory(:user)
a = Factory(:authorization, :user => u)

log_in(u, a.uid)

51.times do
u2 = Factory(:user)
u.follow! u2.feed.url
end

visit "/users/#{u.username}/following"

click_link "next_button"

assert_match "Previous", page.body
assert_match "Next", page.body
end

def test_user_followers_paginates
u = Factory(:user)
a = Factory(:authorization, :user => u)

log_in(u, a.uid)

51.times do
u2 = Factory(:user)
u2.follow! u.feed.url
end

visit "/users/#{u.username}/followers"

click_link "next_button"

assert_match "Previous", page.body
assert_match "Next", page.body
end

def test_user_edit_own_profile_link
u = Factory(:user)
a = Factory(:authorization, :user => u)
Expand Down

0 comments on commit 7f7c26a

Please sign in to comment.