Skip to content

Commit 85cecc0

Browse files
committed
Fix 500 error on group members search
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
1 parent cb58e1c commit 85cecc0

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

app/controllers/groups_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def members
6868
@members = group.users_groups
6969

7070
if params[:search].present?
71-
users = group.users.search(params[:search])
71+
users = group.users.search(params[:search]).to_a
7272
@members = @members.where(user_id: users)
7373
end
7474

features/group.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,10 @@ Feature: Groups
113113
Then I should see user "John Doe" in team list
114114
Then I should see user "Mary Jane" in team list
115115
Then I should not see the "Remove User From Group" button for "Mary Jane"
116+
117+
Scenario: Search member by name
118+
Given "Mary Jane" is guest of group "Guest"
119+
And I visit group "Guest" members page
120+
When I search for 'Mary' member
121+
Then I should see user "Mary Jane" in team list
122+
Then I should not see user "John Doe" in team list

features/steps/group/group.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ class Groups < Spinach::FeatureSteps
157157
# poltergeist always confirms popups.
158158
end
159159

160+
step 'I search for \'Mary\' member' do
161+
within '.member-search-form' do
162+
fill_in 'search', with: 'Mary'
163+
click_button 'Search'
164+
end
165+
end
166+
160167
protected
161168

162169
def assigned_to_me key

0 commit comments

Comments
 (0)