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
This commit is contained in:
parent
a59bd805d3
commit
f2021227e7
|
@ -66,18 +66,30 @@ class AuthSourcesControllerTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
context "post :destroy" do
|
context "post :destroy" do
|
||||||
context "without users" do
|
|
||||||
setup do
|
setup do
|
||||||
@auth_source = AuthSource.generate!(:name => 'TestEdit')
|
@auth_source = AuthSource.generate!(:name => 'TestEdit')
|
||||||
|
end
|
||||||
|
|
||||||
|
context "without users" do
|
||||||
|
setup do
|
||||||
post :destroy, :id => @auth_source.id
|
post :destroy, :id => @auth_source.id
|
||||||
end
|
end
|
||||||
|
|
||||||
should_respond_with :redirect
|
should_respond_with :redirect
|
||||||
should_redirect_to("index") {{:action => 'index'}}
|
should_redirect_to("index") {{:action => 'index'}}
|
||||||
should_set_the_flash_to /deletion/i
|
should_set_the_flash_to /deletion/i
|
||||||
|
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue