Commit 85cecc0b2ef25ef4e4dc56583b0e202400168abb
1 parent
cb58e1cb
Exists in
spb-stable
and in
2 other branches
Fix 500 error on group members search
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
15 additions
and
1 deletions
Show diff stats
app/controllers/groups_controller.rb
| ... | ... | @@ -68,7 +68,7 @@ class GroupsController < ApplicationController |
| 68 | 68 | @members = group.users_groups |
| 69 | 69 | |
| 70 | 70 | if params[:search].present? |
| 71 | - users = group.users.search(params[:search]) | |
| 71 | + users = group.users.search(params[:search]).to_a | |
| 72 | 72 | @members = @members.where(user_id: users) |
| 73 | 73 | end |
| 74 | 74 | ... | ... |
features/group.feature
| ... | ... | @@ -113,3 +113,10 @@ Feature: Groups |
| 113 | 113 | Then I should see user "John Doe" in team list |
| 114 | 114 | Then I should see user "Mary Jane" in team list |
| 115 | 115 | 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
| ... | ... | @@ -157,6 +157,13 @@ class Groups < Spinach::FeatureSteps |
| 157 | 157 | # poltergeist always confirms popups. |
| 158 | 158 | end |
| 159 | 159 | |
| 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 | + | |
| 160 | 167 | protected |
| 161 | 168 | |
| 162 | 169 | def assigned_to_me key | ... | ... |