|  |  | @@ -292,5 +292,19 @@ describe AgentsController do | 
            
            
              | 292 | 292 |          delete :destroy, :id => agents(:jane_website_agent).to_param | 
            
            
              | 293 | 293 |        }.should raise_error(ActiveRecord::RecordNotFound) | 
            
            
              | 294 | 294 |      end | 
            
            
              |  | 295 | + | 
            
            
              |  | 296 | +    it "redirects correctly when the Agent is deleted from the Agent itself" do | 
            
            
              |  | 297 | +      sign_in users(:bob) | 
            
            
              |  | 298 | + | 
            
            
              |  | 299 | +      delete :destroy, :id => agents(:bob_website_agent).to_param | 
            
            
              |  | 300 | +      response.should redirect_to agents_path | 
            
            
              |  | 301 | +    end | 
            
            
              |  | 302 | + | 
            
            
              |  | 303 | +    it "redirects correctly when the Agent is deleted from a Scenario" do | 
            
            
              |  | 304 | +      sign_in users(:bob) | 
            
            
              |  | 305 | + | 
            
            
              |  | 306 | +      delete :destroy, :id => agents(:bob_weather_agent).to_param, :return => scenario_path(scenarios(:bob_weather)).to_param | 
            
            
              |  | 307 | +      response.should redirect_to scenario_path(scenarios(:bob_weather)) | 
            
            
              |  | 308 | +    end | 
            
            
              | 295 | 309 |    end | 
            
            
              | 296 | 310 |  end |