User.orphan_account fails to create the user on a new database

Description

On a new database, we attempt to create the orphan_account user if doesn't exist.

https://github.com/otwcode/otwarchive/blob/854a4926c67c0419b10b1a4fe2165d8ccb8e9d87/app/models/user.rb#L547-L553

This fails because the new user is missing a host of required information (email, password, age check, TOS check), which means in tests we need the extra step of faking orphan_account, e.g. for Cucumber tests:

https://github.com/otwcode/otwarchive/blob/854a4926c67c0419b10b1a4fe2165d8ccb8e9d87/features/step_definitions/user_steps.rb#L11-L14

(This is not a problem on production or staging, which already has the orphan_account user.

Possible fix: orphan_account doesn't actually need to be valid, so we could just skip validations when creating it. Then we can remove the extra setup steps in tests.

How to test: check if we can still orphan works.

Assignee

Unassigned

Reporter

redsummernight

Roadmap

Orphaning

Priority

Low

Affects versions

Fix versions

None

Components

AutomatedTests
BackEnd

Difficulty

Medium

Milestone

Internal 0.9
Configure