]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/user_controller_test.rb
Fix new rubocopy warnings
[rails.git] / test / controllers / user_controller_test.rb
index 7a1310d6e9c75bbfb087002d2b9e120857fdfd94..37b8a7f30efaf39987a87b2e4b5957e59ae6fa67 100644 (file)
@@ -474,6 +474,8 @@ class UserControllerTest < ActionController::TestCase
   end
 
   def test_confirm_resend_success
+    session[:token] = users(:inactive_user).tokens.create.token
+
     assert_difference "ActionMailer::Base.deliveries.size", 1 do
       get :confirm_resend, :display_name => users(:inactive_user).display_name
     end
@@ -489,7 +491,17 @@ class UserControllerTest < ActionController::TestCase
     ActionMailer::Base.deliveries.clear
   end
 
-  def test_confirm_resend_failure
+  def test_confirm_resend_no_token
+    assert_no_difference "ActionMailer::Base.deliveries.size" do
+      get :confirm_resend, :display_name => users(:inactive_user).display_name
+    end
+
+    assert_response :redirect
+    assert_redirected_to login_path
+    assert_match "User Inactive User not found.", flash[:error]
+  end
+
+  def test_confirm_resend_unknown_user
     assert_no_difference "ActionMailer::Base.deliveries.size" do
       get :confirm_resend, :display_name => "No Such User"
     end
@@ -1321,7 +1333,7 @@ class UserControllerTest < ActionController::TestCase
     get :list, :page => 3
     assert_response :success
     assert_template :list
-    assert_select "table#user_list tr", :count => 20
+    assert_select "table#user_list tr", :count => 22
   end
 
   def test_list_post_confirm