16470: Fixes test on user model.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 24 Jul 2020 14:47:16 +0000 (11:47 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 24 Jul 2020 14:47:16 +0000 (11:47 -0300)
commit070bcb4e6afda609a371a5bfc7d0927f379e4531
treec305e09ecf0db9624b85362fe9c71bf88eb44652
parent22589907a1c0017965eee98a9839285a1402788b
16470: Fixes test on user model.

Rails 5.1 deprecated the attr_changed? in favor of more explicit methods
because there was ambiguity when called from an 'after' or 'before' callback.
The test UsersTest#test_cannot_set_is_active_to_false_directly started failing
because User.setup is called from both types of callbacks, so its internal
checks weren't passing in some cases.

Also, avoids doing unnecessary queries to get the 'All users' group.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>
services/api/app/models/user.rb