fix build list factory

same as https://github.com/warpc/rosa-build/pull/799/files#diff-26
This commit is contained in:
Alexander Machehin 2013-01-09 16:23:34 +06:00
parent 71125eac81
commit 508ec266f0
1 changed files with 12 additions and 4 deletions

View File

@ -4,7 +4,11 @@ FactoryGirl.define do
association :user association :user
#association :project #association :project
association :save_to_platform, :factory => :platform_with_repos association :save_to_platform, :factory => :platform_with_repos
project { |bl| FactoryGirl.create(:project_with_commit, :repositories => [bl.save_to_platform.repositories.first]) } project { |bl|
pr = FactoryGirl.create(:project_with_commit)
bl.save_to_platform.repositories.first.projects << pr
pr
}
association :arch association :arch
build_for_platform {|bl| bl.save_to_platform} build_for_platform {|bl| bl.save_to_platform}
save_to_repository {|bl| bl.save_to_platform.repositories.first} save_to_repository {|bl| bl.save_to_platform.repositories.first}
@ -27,7 +31,11 @@ FactoryGirl.define do
end end
factory :build_list_by_group_project, :parent => :build_list_core do factory :build_list_by_group_project, :parent => :build_list_core do
project { |bl| FactoryGirl.create(:group_project_with_commit, :repositories => [bl.save_to_platform.repositories.first]) } project { |bl|
pr = FactoryGirl.create(:group_project_with_commit)
bl.save_to_platform.repositories.first.projects << pr
pr
}
end end
factory :build_list_package, :class => BuildList::Package do factory :build_list_package, :class => BuildList::Package do