#31: update specs for Product model
This commit is contained in:
parent
9a37bb0a8a
commit
7f1990bbb3
|
@ -9,8 +9,5 @@ FactoryGirl.define do
|
|||
params 'ENV=i586'
|
||||
time_living 150
|
||||
project_version 'master'
|
||||
|
||||
# see: before_validation in ProductBuildList model
|
||||
before(:create) { Arch.find_or_create_by_name('x86_64') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,5 +5,8 @@ FactoryGirl.define do
|
|||
association :platform, :factory => :platform
|
||||
association :project, :factory => :project_with_commit
|
||||
time_living 150
|
||||
|
||||
# see: before_validation in ProductBuildList model
|
||||
before(:create) { Arch.find_or_create_by_name('x86_64') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,8 +30,10 @@ describe Product do
|
|||
|
||||
context 'by autostart_status = once_a_12_hours' do
|
||||
before do
|
||||
product.update_attributes(:autostart_status => Product::ONCE_A_12_HOURS)
|
||||
FactoryGirl.create(:product, :autostart_status => Product::ONCE_A_DAY)
|
||||
stub_symlink_methods
|
||||
stub_redis
|
||||
product.update_attributes(:autostart_status => Product::ONCE_A_12_HOURS, :main_script => 'text.sh')
|
||||
FactoryGirl.create(:product, :autostart_status => Product::ONCE_A_DAY, :main_script => 'text.sh')
|
||||
end
|
||||
|
||||
it 'should be created only one product_build_list' do
|
||||
|
@ -39,6 +41,7 @@ describe Product do
|
|||
end
|
||||
|
||||
it 'product should has product_build_list' do
|
||||
Product.autostart_iso_builds Product::ONCE_A_12_HOURS
|
||||
product.product_build_lists.should have(1).item
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue