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, 7 Aug 2020 14:54:35 +0000 (11:54 -0300)
commit498ac72a688f3ff44dc143dcbd248e3e8bc7cfe3
tree6e4c30e5c79b213f0381e2fc7f114c34daa939c0
parent779be4daad18b12e8dd14f84b6f6851cffd00114
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