@@ -69,7 +69,7 class AuthSourcesControllerTest < ActionController::TestCase | |||||
69 | setup do |
|
69 | setup do | |
70 | @auth_source = AuthSource.generate!(:name => 'TestEdit') |
|
70 | @auth_source = AuthSource.generate!(:name => 'TestEdit') | |
71 | end |
|
71 | end | |
72 |
|
72 | |||
73 | context "without users" do |
|
73 | context "without users" do | |
74 | setup do |
|
74 | setup do | |
75 | post :destroy, :id => @auth_source.id |
|
75 | post :destroy, :id => @auth_source.id | |
@@ -79,13 +79,13 class AuthSourcesControllerTest < ActionController::TestCase | |||||
79 | should_redirect_to("index") {{:action => 'index'}} |
|
79 | should_redirect_to("index") {{:action => 'index'}} | |
80 | should_set_the_flash_to /deletion/i |
|
80 | should_set_the_flash_to /deletion/i | |
81 | end |
|
81 | end | |
82 |
|
82 | |||
83 | context "with users" do |
|
83 | context "with users" do | |
84 | setup do |
|
84 | setup do | |
85 | User.generate!(:auth_source => @auth_source) |
|
85 | User.generate!(:auth_source => @auth_source) | |
86 | post :destroy, :id => @auth_source.id |
|
86 | post :destroy, :id => @auth_source.id | |
87 | end |
|
87 | end | |
88 |
|
88 | |||
89 | should_respond_with :redirect |
|
89 | should_respond_with :redirect | |
90 | should "not destroy the AuthSource" do |
|
90 | should "not destroy the AuthSource" do | |
91 | assert AuthSource.find(@auth_source.id) |
|
91 | assert AuthSource.find(@auth_source.id) |
General Comments 0
You need to be logged in to leave comments.
Login now