diff --git a/db/seeds.rb b/db/seeds.rb index 446698d82..7a96639d9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,3 +15,17 @@ TEST_USERS.each do |tuser| User.create! :name => name, :email => email, :password => pass, :password_confirmation => pass puts "Created user #{name} (#{email}) and password #{pass}" end + + +TEST_PLATFORMS = %w(cooker Mandriva2010.10 Mandriva2011.4) +TEST_PROJECTS = %w(gcc glibc mysql-dev ruby ruby1.9 mc mesa avrdude vim gvim openssh-server openssh nethack binutils build-essentials rpm rpmtools ffmpeg mkvtoolnix libogg mpg123 openbox openoffice.org) + + +TEST_PLATFORMS.each do |platform| + p = Platform.find_or_create_by_name(platform) + TEST_PROJECTS.each do |project| + pr = Project.find_or_initialize_by_platform_id_and_name(p.id, project) + puts "#{project} added to #{platform}" if pr.new_record? + pr.save! + end +end