rosa-build/spec/factories/build_lists.rb

37 lines
1.2 KiB
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
FactoryGirl.define do
factory :build_list do
association :user
#association :project
association :save_to_platform, :factory => :platform_with_repos
project { |bl| FactoryGirl.create(:project_with_commit, :repositories => [bl.save_to_platform.repositories.first]) }
association :arch
2012-05-04 18:12:51 +01:00
build_for_platform {|bl| bl.save_to_platform}
save_to_repository {|bl| bl.save_to_platform.repositories.first}
build_requires true
update_type 'security'
2012-05-04 18:12:51 +01:00
include_repos {|bl| bl.save_to_platform.repositories.map(&:id)}
2012-10-11 11:55:06 +01:00
project_version 'latest_master'
commit_hash {|bl| Grit::Repo.new(bl.project.path).commits.first.id}
end
factory :build_list_core, :parent => :build_list do
bs_id { FactoryGirl.generate(:integer) }
end
2012-06-18 17:19:09 +01:00
factory :build_list_by_group_project, :parent => :build_list_core do
project { |bl| FactoryGirl.create(:group_project, :repositories => [bl.save_to_platform.repositories.first]) }
end
2012-06-18 17:19:09 +01:00
factory :build_list_package, :class => BuildList::Package do
association :build_list
association :project
association :platform
fullname "test_package"
name "test_package"
version "3.1.12"
release 6
package_type "source"
end
end