Feature #33347 » 31198-v3.patch
| app/helpers/users_helper.rb | ||
|---|---|---|
|
'lastname',
|
||
|
'mail',
|
||
|
'admin',
|
||
|
'updated_on',
|
||
|
'created_on',
|
||
|
'last_login_on',
|
||
|
'passwd_changed_on',
|
||
|
'status'
|
||
|
]
|
||
|
user_custom_fields = UserCustomField.all
|
||
| config/locales/en.yml | ||
|---|---|---|
|
field_mail_notification: Email notifications
|
||
|
field_admin: Administrator
|
||
|
field_last_login_on: Last connection
|
||
|
field_passwd_changed_on: Last password change on
|
||
|
field_language: Language
|
||
|
field_effective_date: Due date
|
||
|
field_password: Password
|
||
| test/functional/users_controller_test.rb | ||
|---|---|---|
|
def test_index_csv
|
||
|
with_settings :default_language => 'en' do
|
||
|
user = User.logged.status(1).first
|
||
|
user.update(passwd_changed_on: Time.current.last_month)
|
||
|
get :index, :params => { :format => 'csv' }
|
||
|
assert_response :success
|
||
|
assert_equal User.logged.status(1).count, response.body.chomp.split("\n").size - 1
|
||
|
assert_include 'active', response.body
|
||
|
assert_not_include 'locked', response.body
|
||
|
assert_include format_time(user.updated_on), response.body
|
||
|
assert_include format_time(user.passwd_changed_on), response.body
|
||
|
assert_equal 'text/csv', @response.media_type
|
||
|
end
|
||
|
end
|
||