#794: update build_list factory

This commit is contained in:
Vokhmin Alexey V 2012-12-20 21:22:27 +04:00
parent 09731e041e
commit f7d2a426a7
1 changed files with 10 additions and 2 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}
@ -20,7 +24,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