]> source.dussan.org Git - redmine.git/commitdiff
Adds a test for AuthSourcesController#destroy with users.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 16 Mar 2011 19:52:16 +0000 (19:52 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 16 Mar 2011 19:52:16 +0000 (19:52 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5155 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/auth_sources_controller_test.rb

index eadbaa73c5b951a1a4cb89869ecf4296afba1836..5f65f419be32c2d596caa880b2c6a1fa2caf66e5 100644 (file)
@@ -66,18 +66,30 @@ class AuthSourcesControllerTest < ActionController::TestCase
   end
 
   context "post :destroy" do
+    setup do
+      @auth_source = AuthSource.generate!(:name => 'TestEdit')
+    end
+    
     context "without users" do
       setup do
-        @auth_source = AuthSource.generate!(:name => 'TestEdit')
         post :destroy, :id => @auth_source.id
       end
 
       should_respond_with :redirect
       should_redirect_to("index") {{:action => 'index'}}
       should_set_the_flash_to /deletion/i
-
     end
     
-    should "be tested with users"
+    context "with users" do
+      setup do
+        User.generate!(:auth_source => @auth_source)
+        post :destroy, :id => @auth_source.id
+      end
+      
+      should_respond_with :redirect
+      should "not destroy the AuthSource" do
+        assert AuthSource.find(@auth_source.id)
+      end
+    end
   end
 end