Mercurial > hg > soundsoftware-site
comparison test/functional/roles_controller_test.rb @ 524:1248a47e81b3 feature_36
Merge from branch "luisf"
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 14:39:38 +0100 |
parents | cbce1fd3b1b7 |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
519:3be6bc3c2a17 | 524:1248a47e81b3 |
---|---|
13 # | 13 # |
14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
15 # along with this program; if not, write to the Free Software | 15 # along with this program; if not, write to the Free Software |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 |
18 require File.dirname(__FILE__) + '/../test_helper' | 18 require File.expand_path('../../test_helper', __FILE__) |
19 require 'roles_controller' | 19 require 'roles_controller' |
20 | 20 |
21 # Re-raise errors caught by the controller. | 21 # Re-raise errors caught by the controller. |
22 class RolesController; def rescue_action(e) raise e end; end | 22 class RolesController; def rescue_action(e) raise e end; end |
23 | 23 |
24 class RolesControllerTest < ActionController::TestCase | 24 class RolesControllerTest < ActionController::TestCase |
25 fixtures :roles, :users, :members, :member_roles, :workflows | 25 fixtures :roles, :users, :members, :member_roles, :workflows, :trackers |
26 | 26 |
27 def setup | 27 def setup |
28 @controller = RolesController.new | 28 @controller = RolesController.new |
29 @request = ActionController::TestRequest.new | 29 @request = ActionController::TestRequest.new |
30 @response = ActionController::TestResponse.new | 30 @response = ActionController::TestResponse.new |
112 end | 112 end |
113 | 113 |
114 def test_destroy_role_in_use | 114 def test_destroy_role_in_use |
115 post :destroy, :id => 1 | 115 post :destroy, :id => 1 |
116 assert_redirected_to '/roles' | 116 assert_redirected_to '/roles' |
117 assert flash[:error] == 'This role is in use and can not be deleted.' | 117 assert flash[:error] == 'This role is in use and cannot be deleted.' |
118 assert_not_nil Role.find_by_id(1) | 118 assert_not_nil Role.find_by_id(1) |
119 end | 119 end |
120 | 120 |
121 def test_get_report | 121 def test_get_report |
122 get :report | 122 get :report |