[26099] Default to 'all' status filter (#5852)

https://community.openproject.com/wp/26099

[ci skip]
pull/5856/head
Oliver Günther 7 years ago committed by GitHub
parent eb2c6ab47f
commit aa802968cb
  1. 4
      app/cells/user_filter_cell.rb
  2. 11
      spec/features/members/invitation_spec.rb
  3. 2
      spec_legacy/functional/users_controller_spec.rb

@ -23,10 +23,10 @@ class UserFilterCell < RailsCell
##
# Returns the selected status from the parameters
# or the default status to be filtered by (active)
# or the default status to be filtered by (all)
# if no status is given.
def status_param(params)
params[:status].presence || :active
params[:status].presence || 'all'
end
def filter_name(query, name)

@ -54,15 +54,20 @@ feature 'invite user via email', type: :feature, js: true do
expect(members_page).to have_added_user('finkelstein @openproject.com')
expect(members_page).to have_user 'finkelstein @openproject.com'
# Should show the invited user on the default filter as well
members_page.visit!
expect(members_page).to have_user 'finkelstein @openproject.com'
end
end
context 'with a registered user' do
let!(:user) do
FactoryGirl.create :user, mail: 'hugo@openproject.com',
login: 'hugo@openproject.com',
firstname: 'Hugo',
lastname: 'Hurried'
login: 'hugo@openproject.com',
firstname: 'Hugo',
lastname: 'Hurried'
end
scenario 'user lookup by email' do

@ -52,8 +52,6 @@ describe UsersController, type: :controller do
assert_response :success
assert_template 'index'
refute_nil assigns(:users)
# active users only
assert_nil(assigns(:users).detect { |u| !u.active? })
end
it 'should index with name filter' do

Loading…
Cancel
Save