Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix user seeds not populating from pwned_password validation #2315

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
.idea/
.tags
*.swp
.tool-versions

# Ignore coverage results
/coverage
Expand Down
11 changes: 7 additions & 4 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
# Mayor.create(name: 'Emanuel', city: cities.first)

# Users
user1 = User.create(name: 'Test1 Lastname', email: 'test1@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada', about: 'Hi my name is Test1! I want to use the site so that I can improve the way I handle my anxiety.')
user2 = User.create(name: 'Test2 Lastname', email: 'test2@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada')
user3 = User.create(name: 'Test3 Two-Lastnames', email: 'test3@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States')
user4 = User.create(name: 'Admin User', email: 'admin@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States', admin: true)
user1 = User.new(name: 'Test1 Lastname', email: 'test1@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada', about: 'Hi my name is Test1! I want to use the site so that I can improve the way I handle my anxiety.')
user2 = User.new(name: 'Test2 Lastname', email: 'test2@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'Toronto, ON, Canada')
user3 = User.new(name: 'Test3 Two-Lastnames', email: 'test3@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States')
user4 = User.new(name: 'Admin User', email: 'admin@example.com', password: 'passworD@99', confirmed_at: Time.zone.now, location: 'San Francisco, CA, United States', admin: true)

## Save with validate: false to bypass pwned_password data breach check for seeding users
[user1, user2, user3, user4].each { |user| user.save!(validate: false) }

# Allies
Allyship.create(user_id: user1.id, ally_id: user2.id, status: :accepted)
Expand Down