Mercurial > hg > soundsoftware-site
comparison test/functional/groups_controller_test.rb @ 511:107d36338b70 live
Merge from branch "cannam"
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:43:07 +0100 |
parents | cbce1fd3b1b7 |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
451:a9f6345cb43d | 511:107d36338b70 |
---|---|
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 'groups_controller' | 19 require 'groups_controller' |
20 | 20 |
21 # Re-raise errors caught by the controller. | 21 # Re-raise errors caught by the controller. |
22 class GroupsController; def rescue_action(e) raise e end; end | 22 class GroupsController; def rescue_action(e) raise e end; end |
23 | 23 |
102 def test_destroy_membership | 102 def test_destroy_membership |
103 assert_difference 'Group.find(10).members.count', -1 do | 103 assert_difference 'Group.find(10).members.count', -1 do |
104 post :destroy_membership, :id => 10, :membership_id => 6 | 104 post :destroy_membership, :id => 10, :membership_id => 6 |
105 end | 105 end |
106 end | 106 end |
107 | |
108 def test_autocomplete_for_user | |
109 get :autocomplete_for_user, :id => 10, :q => 'mis' | |
110 assert_response :success | |
111 users = assigns(:users) | |
112 assert_not_nil users | |
113 assert users.any? | |
114 assert !users.include?(Group.find(10).users.first) | |
115 end | |
107 end | 116 end |