comparison test/functional/groups_controller_test.rb @ 1295:622f24f53b42 redmine-2.3

Update to Redmine SVN revision 11972 on 2.3-stable branch
author Chris Cannam
date Fri, 14 Jun 2013 09:02:21 +0100
parents 433d4f72a19b
children e248c7af89ec
comparison
equal deleted inserted replaced
1294:3e4c3460b6ca 1295:622f24f53b42
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
77 77
78 def test_edit 78 def test_edit
79 get :edit, :id => 10 79 get :edit, :id => 10
80 assert_response :success 80 assert_response :success
81 assert_template 'edit' 81 assert_template 'edit'
82 assert_tag 'div', :attributes => {:id => 'tab-content-users'} 82
83 assert_tag 'div', :attributes => {:id => 'tab-content-memberships'} 83 assert_select 'div#tab-content-users'
84 assert_select 'div#tab-content-memberships' do
85 assert_select 'a', :text => 'Private child of eCookbook'
86 end
84 end 87 end
85 88
86 def test_update 89 def test_update
87 new_name = 'New name' 90 new_name = 'New name'
88 put :update, :id => 10, :group => {:name => new_name} 91 put :update, :id => 10, :group => {:name => new_name}
190 assert_equal 'text/javascript', response.content_type 193 assert_equal 'text/javascript', response.content_type
191 end 194 end
192 end 195 end
193 196
194 def test_autocomplete_for_user 197 def test_autocomplete_for_user
195 get :autocomplete_for_user, :id => 10, :q => 'mis' 198 get :autocomplete_for_user, :id => 10, :q => 'smi', :format => 'js'
196 assert_response :success 199 assert_response :success
197 users = assigns(:users) 200 assert_include 'John Smith', response.body
198 assert_not_nil users
199 assert users.any?
200 assert !users.include?(Group.find(10).users.first)
201 end 201 end
202 end 202 end