Set RAILS_ENV to test for consistency.

Possible fix for #793