#46: update specs, fix '[]' for false:FalseClass

This commit is contained in:
Vokhmin Alexey V 2013-03-22 16:13:25 +04:00
parent 03dc35b70e
commit 0ae4606827
2 changed files with 10 additions and 3 deletions

View File

@ -32,7 +32,7 @@ module AbfWorker
def sort_results_and_save(results, item = subject)
item.results = results.sort_by{ |r| r['file_name'] }
item.save(false)
item.save(:validate => false)
end
end

View File

@ -186,11 +186,18 @@ describe AbfWorker::BuildListsPublishTaskManager do
:save_to_repository => build_list.save_to_repository,
:build_for_platform => build_list.build_for_platform
) }
let(:build_list3) { FactoryGirl.create(:build_list_core,
:new_core => true,
:save_to_platform => build_list.save_to_platform,
:save_to_repository => build_list.save_to_repository,
:build_for_platform => build_list.build_for_platform
) }
before do
stub_redis
build_list.update_column(:status, BuildList::BUILD_PUBLISH)
build_list2.update_column(:status, BuildList::BUILD_PUBLISHED)
ProjectToRepository.where(:project_id => build_list.project_id, :repository_id => build_list.save_to_repository_id).destroy_all
build_list3.update_column(:status, BuildList::BUILD_PUBLISHED)
ProjectToRepository.where(:project_id => build_list3.project_id, :repository_id => build_list3.save_to_repository_id).destroy_all
2.times{ subject.new.run }
end
@ -212,7 +219,7 @@ describe AbfWorker::BuildListsPublishTaskManager do
it "ensure that 'locked projects for cleanup' has only one item" do
queue = @redis_instance.lrange(subject::LOCKED_PROJECTS_FOR_CLEANUP, 0, -1)
queue.should have(1).item
queue.should include("#{build_list.project_id}-#{build_list.save_to_repository_id}-#{build_list.build_for_platform_id}")
queue.should include("#{build_list3.project_id}-#{build_list3.save_to_repository_id}-#{build_list3.build_for_platform_id}")
end
it "ensure that new task for publishing has been created" do