Logging in with a test user
Hello! I'm working on getting Loomio running on my local machine for the first time. I've successfully loaded the dashboard, but it prompts me to log in with my email, and I'm not sure where to go from there.
How do people usually go about setting up a user locally? Are there any settings I have to update for my user in the Rails console that will allow me to bypass logging in with email?
Thanks!
Thanks so much! I'll give that a try.
Yup, worked perfectly! Thanks. :)
Hi Emily,
Thanks for your interest in developing on Loomio! Here's a couple things that might be useful:
Once your server is running, you can visit
localhost:3000/dev(also/dev/pollsanddev/discussions) to get a long list of 'scenarios' you can set up, most of which involve creating and signing in as a user (/dev/setup_groupmight be a good place to start). Note that most of these routes will wipe the existing threads, groups, and users in your development database.Once you've been asked to go check your email, you can visit the
/dev/use_last_login_tokenroute to automatically log in as the last user who was sent a login tokenYou're more than welcome to write some more scenarios to match whatever state you're looking to achieve by writing more methods in
dev/main_controller.rb; these will appear automatically as routes once they're written.For obvious reasons, these routes are removed in non-dev environments.