]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/users_controller_test.rb
Merge remote-tracking branch 'upstream/pull/5234'
[rails.git] / test / controllers / users_controller_test.rb
index c5566e65db4ae534015fa97331fba7c6f2c7fd05..dda157f01552cbcbc62664b64183d9e83ed56ae8 100644 (file)
@@ -325,9 +325,6 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
       assert_select "a[href='/blocks/new/#{ERB::Util.u(user.display_name)}']", 0
     end
 
       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)
     # Test a user who has been blocked
     blocked_user = create(:user)
     create(:user_block, :user => blocked_user)
@@ -479,7 +476,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     moderator_user = create(:moderator_user)
     administrator_user = create(:administrator_user)
     _suspended_user = create(:user, :suspended)
     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
 
     # There are now 7 users - the five above, plus two extra "granters" for the
     # moderator_user and administrator_user
@@ -558,6 +555,18 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     check_no_page_link "Older Users"
   end
 
     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)
   private
 
   def check_no_page_link(name)