docbrown/lib/tasks/e2e_seed.rake
Ridhwana e827b8bab9
Minimal Seed Data for Admin Onboarding (#14385)
* minimal seeded flows

* fix: remove mistake

* refactor: rename the files appropriately

* feat: change some text

* fix: typo

* chore: new commit to rebuild
2021-07-29 17:08:41 +02:00

22 lines
775 B
Ruby

# Thanks to https://stackoverflow.com/questions/19872271/adding-a-custom-seed-file/31815032#31815032
SEED_DIR = Rails.root.join("spec/support/seeds/")
namespace :db do
namespace :seed do
desc "Seed data for e2e tests"
task e2e: :environment do
raise "Attempting to seed production environment, aborting!" if Rails.env.production?
filename = SEED_DIR.join("seeds_e2e.rb")
load(filename) if File.exist?(filename)
end
desc "Creator Onboarding seed data for e2e tests"
task e2e_creator_onboarding: :environment do
raise "Attempting to seed production environment, aborting!" if Rails.env.production?
filename = SEED_DIR.join("creator_onboarding_seed_e2e.rb")
load(filename) if File.exist?(filename)
end
end
end