Skip to content
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 lib/tasks/seeds_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module SeedsHelper
TEST_USERS = {
jane_doe: '583ba872-b16e-46e1-9f7d-df89d267550d', # jane.doe@example.com
john_doe: 'bbb9b8fd-f357-4238-983d-6f87b99bdbb2', # john.doe@example.com
johan_doe: 'cccccccc-f357-4238-983d-6f87b99bdbb2', # teacher with no associated class
jane_smith: 'e52de409-9210-4e94-b08c-dd11439e07d9', # student
john_smith: '0d488bec-b10d-46d3-b6f3-4cddf5d90c71', # student
emily_ssouser: '88e0aed6-8f20-4e40-98f9-610a0ab1cfcc', # sso student
Expand Down
7 changes: 7 additions & 0 deletions lib/tasks/test_seeds.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace :test_seeds do
creator_id = ENV.fetch('SEEDING_CREATOR_ID', TEST_USERS[:jane_doe])
teacher_id = ENV.fetch('SEEDING_TEACHER_ID', TEST_USERS[:john_doe])
teacher_signup_id = TEST_USERS[:jim_dun]
teacher_unassigned_id = TEST_USERS[:johan_doe]

# Hard coded as the student's school needs to match
student_ids = [TEST_USERS[:jane_smith], TEST_USERS[:john_smith], TEST_USERS[:emily_ssouser]]
Expand All @@ -21,6 +22,7 @@ namespace :test_seeds do

# Remove the roles first
Role.where(user_id: teacher_signup_id).destroy_all
Role.where(user_id: teacher_unassigned_id).destroy_all
Role.where(user_id: [creator_id, teacher_id] + student_ids).destroy_all

# Destroy the project and then the lesson itself (The lesson's `before_destroy` prevents us using destroy)
Expand Down Expand Up @@ -58,11 +60,16 @@ namespace :test_seeds do

creator_id = ENV.fetch('SEEDING_CREATOR_ID', TEST_USERS[:jane_doe])
teacher_id = ENV.fetch('SEEDING_TEACHER_ID', TEST_USERS[:john_doe])
teacher_unassigned_id = TEST_USERS[:johan_doe]

school = create_school(creator_id, TEST_SCHOOL)

verify_school(school)

school.school_email_domains.build(domain: 'example.com').save!
Comment thread
mwtrew marked this conversation as resolved.

assign_a_teacher(teacher_id, school)
assign_a_teacher(teacher_unassigned_id, school)

# for each of the owner and teacher, create a class and assign students
[creator_id, teacher_id].each do |user_id|
Expand Down
Loading