summaryrefslogtreecommitdiffstats
path: root/test/functional/auth_sources_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-16 19:52:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-16 19:52:16 +0000
commite904a5aae68e7787c5e4f2423bb996d00bb2af12 (patch)
tree61c2f07493e61965cfcf4e0b6fbd1bac594122ff /test/functional/auth_sources_controller_test.rb
parent9df5750906521fe3ef5c9f777efdd7b74323e38d (diff)
downloadredmine-e904a5aae68e7787c5e4f2423bb996d00bb2af12.tar.gz
redmine-e904a5aae68e7787c5e4f2423bb996d00bb2af12.zip
Adds a test for AuthSourcesController#destroy with users.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5155 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/auth_sources_controller_test.rb')
-rw-r--r--test/functional/auth_sources_controller_test.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/functional/auth_sources_controller_test.rb b/test/functional/auth_sources_controller_test.rb
index eadbaa73c..5f65f419b 100644
--- a/test/functional/auth_sources_controller_test.rb
+++ b/test/functional/auth_sources_controller_test.rb
@@ -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