010-users_and_teams.rb revision 6f8248a4d5a940787999b9eb3387d8014c64ef0f
1516N/A# Create Admin User.
50N/A@user = User.create!(
50N/A {
50N/A email: 'admin@example.com',
50N/A name: 'admin',
50N/A admin: true,
50N/A password: 'changeme'
50N/A },
50N/A as: :admin
50N/A)
50N/A
50N/A@user.confirm!
50N/A
50N/A# Create Team.
50N/A@team = Team.create! \
50N/A name: 'Lorem Ipsum',
50N/A admin_user: @user
50N/A
50N/A# Create some other users.
50N/A%w(Bob Alice Carol Dave Ted).each_with_index do |name, i|
50N/A @user = User.create! \
50N/A email: "#{name}@example.com",
2026N/A name: name,
2608N/A password: 'changeme'
2026N/A
50N/A @user.confirm!
202N/A
2339N/A # Add two users to the first team.
50N/A @team.users << @user if i < 2
1431N/Aend
1431N/A