2012-03-29 21:34:22 +01:00
|
|
|
FactoryGirl.define do
|
|
|
|
factory :build_list do
|
|
|
|
association :user
|
2012-08-09 15:38:41 +01:00
|
|
|
#association :project
|
2012-05-05 20:26:34 +01:00
|
|
|
association :save_to_platform, :factory => :platform_with_repos
|
2013-01-09 10:23:34 +00:00
|
|
|
project { |bl|
|
|
|
|
pr = FactoryGirl.create(:project_with_commit)
|
|
|
|
bl.save_to_platform.repositories.first.projects << pr
|
|
|
|
pr
|
|
|
|
}
|
2012-03-29 21:34:22 +01:00
|
|
|
association :arch
|
2012-05-04 18:12:51 +01:00
|
|
|
build_for_platform {|bl| bl.save_to_platform}
|
2012-08-15 14:52:32 +01:00
|
|
|
save_to_repository {|bl| bl.save_to_platform.repositories.first}
|
2012-03-29 21:34:22 +01:00
|
|
|
update_type 'security'
|
2012-05-04 18:12:51 +01:00
|
|
|
include_repos {|bl| bl.save_to_platform.repositories.map(&:id)}
|
2013-01-21 17:08:19 +00:00
|
|
|
project_version 'master'
|
2012-12-18 17:53:00 +00:00
|
|
|
commit_hash {|bl| Grit::Repo.new(bl.project.path).commits.first.id}
|
2012-03-29 21:34:22 +01:00
|
|
|
end
|
2011-12-08 18:51:25 +00:00
|
|
|
|
2012-12-26 17:30:27 +00:00
|
|
|
factory :build_list_with_attaching_project, :parent => :build_list do
|
|
|
|
before(:create) { |bl| attach_project_to_build_list bl }
|
2013-01-09 10:23:34 +00:00
|
|
|
end
|
2012-12-26 17:30:27 +00:00
|
|
|
|
2013-07-01 13:20:38 +01:00
|
|
|
factory :build_list_by_group_project, :parent => :build_list do
|
2013-01-09 10:23:34 +00:00
|
|
|
project { |bl|
|
|
|
|
pr = FactoryGirl.create(:group_project_with_commit)
|
|
|
|
bl.save_to_platform.repositories.first.projects << pr
|
|
|
|
pr
|
|
|
|
}
|
2012-09-27 00:54:56 +01:00
|
|
|
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
|
2013-01-29 13:17:35 +00:00
|
|
|
sha1 '4faae977e8b12baa267b566d2bec6e6182754ec4'
|
2012-06-18 17:19:09 +01:00
|
|
|
package_type "source"
|
|
|
|
end
|
2011-12-08 18:51:25 +00:00
|
|
|
end
|
2012-12-26 17:30:27 +00:00
|
|
|
|
|
|
|
def attach_project_to_build_list(bl)
|
|
|
|
bl.save_to_platform ||= FactoryGirl.create(:platform_with_repos)
|
|
|
|
bl.project.repositories << bl.save_to_platform.repositories.first
|
2013-01-09 10:23:34 +00:00
|
|
|
end
|