Skip to content

Instantly share code, notes, and snippets.

@gmgent
Created March 3, 2011 01:05
Show Gist options
  • Save gmgent/852114 to your computer and use it in GitHub Desktop.
Save gmgent/852114 to your computer and use it in GitHub Desktop.
add test users on the fly with unique login
def new_test_user(args={})
i = rand(9999)
random_string = (Time.now.strftime("%s").to_i-i)
final_params = {:password => "testp",
:login => random_string,
:password_confirmation => "testp",
:email => "#{random_string}@gmg-entertainment.com"}.merge!(args)
User.create!(final_params)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment