diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/groups_controller_test.rb | 7 | ||||
-rw-r--r-- | test/functional/members_controller_test.rb | 7 | ||||
-rw-r--r-- | test/integration/routing/groups_test.rb | 4 | ||||
-rw-r--r-- | test/integration/routing/members_test.rb | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 03a5c4229..67edb9261 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -195,11 +195,8 @@ class GroupsControllerTest < ActionController::TestCase end def test_autocomplete_for_user - get :autocomplete_for_user, :id => 10, :q => 'mis' + get :autocomplete_for_user, :id => 10, :q => 'smi', :format => 'js' assert_response :success - users = assigns(:users) - assert_not_nil users - assert users.any? - assert !users.include?(Group.find(10).users.first) + assert_include 'John Smith', response.body end end diff --git a/test/functional/members_controller_test.rb b/test/functional/members_controller_test.rb index 2953b630d..365a4b4bd 100644 --- a/test/functional/members_controller_test.rb +++ b/test/functional/members_controller_test.rb @@ -104,11 +104,8 @@ class MembersControllerTest < ActionController::TestCase end def test_autocomplete - get :autocomplete, :project_id => 1, :q => 'mis' + get :autocomplete, :project_id => 1, :q => 'mis', :format => 'js' assert_response :success - assert_template 'autocomplete' - - assert_tag :label, :content => /User Misc/, - :child => { :tag => 'input', :attributes => { :name => 'membership[user_ids][]', :value => '8' } } + assert_include 'User Misc', response.body end end diff --git a/test/integration/routing/groups_test.rb b/test/integration/routing/groups_test.rb index fe0e1ac80..96d187144 100644 --- a/test/integration/routing/groups_test.rb +++ b/test/integration/routing/groups_test.rb @@ -48,6 +48,10 @@ class RoutingGroupsTest < ActionController::IntegrationTest { :controller => 'groups', :action => 'autocomplete_for_user', :id => '1' } ) assert_routing( + { :method => 'get', :path => "/groups/1/autocomplete_for_user.js" }, + { :controller => 'groups', :action => 'autocomplete_for_user', :id => '1', :format => 'js' } + ) + assert_routing( { :method => 'get', :path => "/groups/1" }, { :controller => 'groups', :action => 'show', :id => '1' } ) diff --git a/test/integration/routing/members_test.rb b/test/integration/routing/members_test.rb index 26ba3e1db..c796eab46 100644 --- a/test/integration/routing/members_test.rb +++ b/test/integration/routing/members_test.rb @@ -55,5 +55,9 @@ class RoutingMembersTest < ActionController::IntegrationTest { :method => 'get', :path => "/projects/5234/memberships/autocomplete" }, { :controller => 'members', :action => 'autocomplete', :project_id => '5234' } ) + assert_routing( + { :method => 'get', :path => "/projects/5234/memberships/autocomplete.js" }, + { :controller => 'members', :action => 'autocomplete', :project_id => '5234', :format => 'js' } + ) end end |