Merge branch 'fix-group-members-search' into 'master'

Fix group members search

Postgres only.
500 error when try to search group members on `/groups/:group_id/members` page
This commit is contained in:
Dmitriy Zaporozhets 2014-05-16 11:43:58 +00:00
commit 6dfd88a145
3 changed files with 15 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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