Loomio
Sun 18 Feb 2018 1:58AM

Logging in with a test user

EG Emily Giurleo Public Seen by 331

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!

JK

James Kiesel Sun 18 Feb 2018 4:25AM

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/polls and dev/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_group might 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_token route to automatically log in as the last user who was sent a login token

  • You'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.

EG

Emily Giurleo Sun 18 Feb 2018 8:10PM

Thanks so much! I'll give that a try.

EG

Emily Giurleo Sun 18 Feb 2018 8:12PM

Yup, worked perfectly! Thanks. :)