E-mail notification when a new user hits the "Inactive user" page.
#3 Updated by Tom Clegg over 6 years ago
- Document how to specify multiple recipients. If array is acceptable, perhaps empty/single should be given as
- In the notification email, include a link to the appropriate users#show page, or at least users#index, so it's easy to click through to see details & activate.
- Use the
set_user_from_auth :adminhelper instead of knowing how to manipulate Thread.current. (Maybe even update all the existing uses of Thread.current in user tests, so people stop copying them.)
- The tests seem to amount to "try all four permutations of A-on/off and B-on/off" which would probably be nicer to do with two nested loops with one test inside, rather than all the copying and pasting. But this works.
- A bit weird that the configuration settings don't get put back to normal after the tests run, although in this case I don't imagine it will actually cause any grief so probably not worth worrying about.
#6 Updated by Tom Clegg over 6 years ago
This isn't reliable. According to "rake test" on my system, you also can't depend on not having system_user in your database at the beginning of the test.
# verify there is one extra user in the db now # the API server also auto-creates the root system user after the first user # is created, hence the test for the delta of 2. assert_equal @all_users.size+2, User.find(:all).size
db/seeds.rb took care of this properly so we didn't need this sort of hack. Ideally we can figure out why this isn't sufficient on your system.
Failing that, we used to have a better workaround (call "system_user" in a setup block to make sure it exists) but you seem to have removed it (by accident?) in e9fc734 -- perhaps it needs to be put back?