diff test/functional/.svn/text-base/auth_sources_controller_test.rb.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 8661b858af72
children
line wrap: on
line diff
--- a/test/functional/.svn/text-base/auth_sources_controller_test.rb.svn-base	Thu Mar 03 11:42:28 2011 +0000
+++ b/test/functional/.svn/text-base/auth_sources_controller_test.rb.svn-base	Mon Jun 06 14:24:13 2011 +0100
@@ -66,18 +66,30 @@
   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