Commit 64622c39afd61edd3f53050b055011428c97021f
Committed by
Antonio Terceiro
1 parent
d73c3900
Exists in
master
and in
29 other branches
ActionItem1127: search by prefix instead of full word
Showing
2 changed files
with
15 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/profile_members_controller.rb
test/functional/profile_members_controller_test.rb
... | ... | @@ -239,4 +239,18 @@ class ProfileMembersControllerTest < Test::Unit::TestCase |
239 | 239 | assert_tag :tag => 'tr', :attributes => {:id => 'tr-test_user', :style => 'display:none'} |
240 | 240 | end |
241 | 241 | |
242 | + should 'return users with <query> as a prefix' do | |
243 | + daniel = create_user('daniel').person | |
244 | + daniela = create_user('daniela').person | |
245 | + | |
246 | + ent = Enterprise.create!(:name => 'Test Ent', :identifier => 'test_ent') | |
247 | + p = create_user_with_permission('test_user', 'manage_memberships', ent) | |
248 | + login_as :test_user | |
249 | + | |
250 | + get :find_users, :profile => ent.identifier, :query => 'daniel' | |
251 | + | |
252 | + assert_includes assigns(:users_found), daniel | |
253 | + assert_includes assigns(:users_found), daniela | |
254 | + end | |
255 | + | |
242 | 256 | end | ... | ... |