33347-v4.patch

Go MAEDA, 2020-04-29 07:13

Download (1.76 KB)

View differences:

app/helpers/users_helper.rb
79 79
        'mail',
80 80
        'admin',
81 81
        'created_on',
82
        'updated_on',
82 83
        'last_login_on',
84
        'passwd_changed_on',
83 85
        'status'
84 86
      ]
85 87
      user_custom_fields = UserCustomField.all
config/locales/en.yml
307 307
  field_mail_notification: Email notifications
308 308
  field_admin: Administrator
309 309
  field_last_login_on: Last connection
310
  field_passwd_changed_on: Password last changed
310 311
  field_language: Language
311 312
  field_effective_date: Due date
312 313
  field_password: Password
test/functional/users_controller_test.rb
68 68

  
69 69
  def test_index_csv
70 70
    with_settings :default_language => 'en' do
71
      user = User.logged.status(1).first
72
      user.update(passwd_changed_on: Time.current.last_month)
71 73
      get :index, :params => { :format => 'csv' }
72 74
      assert_response :success
73 75

  
74 76
      assert_equal User.logged.status(1).count, response.body.chomp.split("\n").size - 1
75 77
      assert_include 'active', response.body
76 78
      assert_not_include 'locked', response.body
79
      assert_include format_time(user.updated_on), response.body
80
      assert_include format_time(user.passwd_changed_on), response.body
77 81
      assert_equal 'text/csv', @response.media_type
78 82
    end
79 83
  end