assert_select "div#content", :count => 1 do
assert_select "form[action='/user/new'][method='post']", :count => 1 do
assert_select "input[id='user_email']", :count => 1
- assert_select "input[id='user_email_confirmation']", :count => 1
assert_select "input[id='user_display_name']", :count => 1
assert_select "input[id='user_pass_crypt'][type='password']", :count => 1
assert_select "input[id='user_pass_crypt_confirmation'][type='password']", :count => 1
assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
end
- # Friends shouldn't be visible as we're not logged in
- assert_select "div#friends-container", :count => 0
-
# Test a user who has been blocked
blocked_user = create(:user)
create(:user_block, :user => blocked_user)
moderator_user = create(:moderator_user)
administrator_user = create(:administrator_user)
_suspended_user = create(:user, :suspended)
- _ip_user = create(:user, :creation_ip => "1.2.3.4")
+ _ip_user = create(:user, :creation_address => "1.2.3.4")
# There are now 7 users - the five above, plus two extra "granters" for the
# moderator_user and administrator_user
check_no_page_link "Older Users"
end
+ def test_index_get_invalid_paginated
+ session_for(create(:administrator_user))
+
+ %w[-1 0 fred].each do |id|
+ get users_path(:before => id)
+ assert_redirected_to :controller => :errors, :action => :bad_request
+
+ get users_path(:after => id)
+ assert_redirected_to :controller => :errors, :action => :bad_request
+ end
+ end
+
private
def check_no_page_link(name)