Merge pull request #806 from warpc/new_core_for_mass_build

New core for mass build (addon)
This commit is contained in:
Vladimir Sharshov 2012-12-25 05:24:09 -08:00
commit 057be1836d
2 changed files with 14 additions and 9 deletions

View File

@ -0,0 +1,5 @@
class AddNewCoreToMassBuild < ActiveRecord::Migration
def change
add_column :mass_builds, :new_core, :boolean, :default => false
end
end

View File

@ -16,8 +16,8 @@ describe BuildList do
before(:all) { ActionMailer::Base.deliveries = [] } before(:all) { ActionMailer::Base.deliveries = [] }
before do before do
build_list.update_attributes(:commit_hash => build_list.project.repo.commits('master').last.id, build_list.update_attributes({:commit_hash => build_list.project.repo.commits('master').last.id,
:status => BuildServer::BUILD_STARTED,) :status => BuildServer::BUILD_STARTED}, :without_protection => true)
end end
after { ActionMailer::Base.deliveries = [] } after { ActionMailer::Base.deliveries = [] }
@ -39,25 +39,25 @@ describe BuildList do
end end
it "gets notification by email when status - Failed publish" do it "gets notification by email when status - Failed publish" do
build_list.update_attributes(:status => BuildList::BUILD_PUBLISH) build_list.update_attributes({:status => BuildList::BUILD_PUBLISH}, :without_protection => true)
build_list.fail_publish build_list.fail_publish
should have(1).item should have(1).item
end end
it "gets notification by email when auto_publish and status - Failed publish" do it "gets notification by email when auto_publish and status - Failed publish" do
build_list.update_attributes(:auto_publish => true, :status => BuildList::BUILD_PUBLISH) build_list.update_attributes({:auto_publish => true, :status => BuildList::BUILD_PUBLISH}, :without_protection => true)
build_list.fail_publish build_list.fail_publish
should have(1).item should have(1).item
end end
it "gets notification by email when status - Build published" do it "gets notification by email when status - Build published" do
build_list.update_attributes(:status => BuildList::BUILD_PUBLISH) build_list.update_attributes({:status => BuildList::BUILD_PUBLISH}, :without_protection => true)
build_list.published build_list.published
should have(1).item should have(1).item
end end
it "gets notification by email when auto_publish and status - Build published" do it "gets notification by email when auto_publish and status - Build published" do
build_list.update_attributes(:auto_publish => true, :status => BuildList::BUILD_PUBLISH) build_list.update_attributes({:auto_publish => true, :status => BuildList::BUILD_PUBLISH}, :without_protection => true)
build_list.published build_list.published
should have(1).item should have(1).item
end end
@ -69,7 +69,7 @@ describe BuildList do
end end
it "doesn't get notification by email when mass build" do it "doesn't get notification by email when mass build" do
build_list.update_attributes(:mass_build_id => 1, :status => BuildList::BUILD_PUBLISH) build_list.update_attributes({:mass_build_id => 1, :status => BuildList::BUILD_PUBLISH}, :without_protection => true)
build_list.published build_list.published
should have(:no).items should have(:no).items
end end
@ -133,8 +133,8 @@ describe BuildList do
:auto_publish => true, :auto_publish => true,
:project => FactoryGirl.create(:project_with_commit, :owner => user)) :project => FactoryGirl.create(:project_with_commit, :owner => user))
FactoryGirl.create(:build_list_package, :build_list => bl, :project => bl.project) FactoryGirl.create(:build_list_package, :build_list => bl, :project => bl.project)
bl.update_attributes(:commit_hash => bl.project.repo.commits('master').last.id, bl.update_attributes({:commit_hash => bl.project.repo.commits('master').last.id,
:status => BuildList::BUILD_PUBLISH) :status => BuildList::BUILD_PUBLISH}, :without_protection => true)
bl.published bl.published
should have(1).item should have(1).item
end end