Skip to content

Commit 062ff12

Browse files
jjfreundJoe Freund
andauthored
Added test user to dev db. Needed for testing go API. (#759)
* Added test user to dev db. Needed for testing go API. * Placated rubocop --------- Co-authored-by: Joe Freund <joefreund@Joes-MacBook-Air.local>
1 parent dfeb312 commit 062ff12

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/sheltertech/db/fixture_populator.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def self.algolia_deferred_index_update(&block)
2828

2929
def populate
3030
Rails.application.eager_load! # Load all models
31+
create_users # Create users first
3132
create_categories
3233
create_resources
3334
create_eligibilities
@@ -59,6 +60,16 @@ def featured_categories
5960
@featured_categories ||= Category.where(featured: true)
6061
end
6162

63+
# Create a test user
64+
def create_users
65+
user = User.new
66+
user.name = "Test User"
67+
user.email = "test@test.com"
68+
user.organization = "Test Organization"
69+
user.user_external_id = "test_user_external_id"
70+
user.save
71+
end
72+
6273
def create_categories
6374
Constants::CATEGORY_NAMES.each { |name| FactoryBot.create(:category, name: name) }
6475
Constants::TOP_LEVEL_CATEGORY_NAMES.each do |c|

0 commit comments

Comments
 (0)