diff options
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r-- | test/functional/users_controller_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index b43d01214..4c287cf3d 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -112,6 +112,9 @@ class UsersControllerTest < Redmine::ControllerTest get :show, :params => {:id => 2} assert_response :success assert_select 'h2', :text => /John Smith/ + + # groups block should not be rendeder for users which are not part of any group + assert_select 'div#groups', 0 end def test_show_should_display_visible_custom_fields @@ -206,6 +209,18 @@ class UsersControllerTest < Redmine::ControllerTest end end + def test_show_user_should_list_user_groups + @request.session[:user_id] = 1 + get :show, :params => {:id => 8} + + assert_select 'div#groups', 1 do + assert_select 'h3', :text => 'Groups' + assert_select 'li', 2 + assert_select 'a[href=?]', '/groups/10/edit', :text => 'A Team' + assert_select 'a[href=?]', '/groups/11/edit', :text => 'B Team' + end + end + def test_new get :new assert_response :success |