summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-16 13:28:35 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-16 13:28:35 +0300
commit85cecc0b2ef25ef4e4dc56583b0e202400168abb (patch)
treebc4839c2a61e0bd888a7f6cccdfd3002515eb501
parentcb58e1cbd74a76c2e25f56e8df1f1f494d14128a (diff)
downloadgitlab-ce-85cecc0b2ef25ef4e4dc56583b0e202400168abb.tar.gz
Fix 500 error on group members search
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/controllers/groups_controller.rb2
-rw-r--r--features/group.feature7
-rw-r--r--features/steps/group/group.rb7
3 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index a3019b3ac78..ddaae6f0e8c 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -68,7 +68,7 @@ class GroupsController < ApplicationController
@members = group.users_groups
if params[:search].present?
- users = group.users.search(params[:search])
+ users = group.users.search(params[:search]).to_a
@members = @members.where(user_id: users)
end
diff --git a/features/group.feature b/features/group.feature
index 4e11bcba939..71c28c07a3c 100644
--- a/features/group.feature
+++ b/features/group.feature
@@ -113,3 +113,10 @@ Feature: Groups
Then I should see user "John Doe" in team list
Then I should see user "Mary Jane" in team list
Then I should not see the "Remove User From Group" button for "Mary Jane"
+
+ Scenario: Search member by name
+ Given "Mary Jane" is guest of group "Guest"
+ And I visit group "Guest" members page
+ When I search for 'Mary' member
+ Then I should see user "Mary Jane" in team list
+ Then I should not see user "John Doe" in team list
diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb
index 81472d1ca35..820d0ef2a1f 100644
--- a/features/steps/group/group.rb
+++ b/features/steps/group/group.rb
@@ -157,6 +157,13 @@ class Groups < Spinach::FeatureSteps
# poltergeist always confirms popups.
end
+ step 'I search for \'Mary\' member' do
+ within '.member-search-form' do
+ fill_in 'search', with: 'Mary'
+ click_button 'Search'
+ end
+ end
+
protected
def assigned_to_me key