Skip to content

Commit

Permalink
Merge pull request #512 from coopdevs/feature/add-phones-search-managers
Browse files Browse the repository at this point in the history
Feature/add phones search feature (only for managers)
  • Loading branch information
sauloperez authored Feb 27, 2020
2 parents d341be9 + d977d53 commit d4b7238
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/users/manage.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="col-md-12">
<%= search_form_for(@search, class: "navbar-form navbar-left", url: manage_users_path) do |f| %>
<div class="form-group">
<%= f.search_field :user_username_or_user_email_or_member_uid_search_contains, class: "form-control" %>
<%= f.search_field :user_username_or_user_email_or_user_phone_or_user_alt_phone_or_member_uid_search_contains, class: "form-control" %>
</div>
<button class="btn btn-default" type="submit">
<%= t 'global.search' %>
Expand Down
11 changes: 11 additions & 0 deletions spec/controllers/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@
end
end
end

context 'when searching' do
it 'allows to search by phone' do
user = Fabricate(:user, phone: 123456789)
member = Fabricate(:member, user: user, organization: test_organization)

get :manage, q: { user_username_or_user_email_or_user_phone_or_user_alt_phone_or_member_uid_search_contains: 123456789 }

expect(assigns(:members)).to include(member)
end
end
end

describe "GET #show" do
Expand Down

0 comments on commit d4b7238

Please sign in to comment.