Skip to content

Set a random password in the User Factory

Nick Malcolm requested to merge 360030-user-factory-random-password into master

What does this MR do and why?

Set a random password in the User Factory. Should hopefully close out Use random passwords in specs (#360030 - closed) 🎉!

Previous MRs have updated our specs to no longer use weak hardcoded passwords. This MR can now update the User factory so it sets a random password every time.

It also updates two further specs which overrode Devise.friendly_token to set a weak/hardcoded value. User.random_password which calls Devise.friendly_token. Overriding friendly_token in specs to do something weak will break User validations and therefore break specs when it can't create a valid user.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #360030 (closed)

Edited by Nick Malcolm

Merge request reports