#403: Fixed: project_spec

This commit is contained in:
Vokhmin Alexey V 2014-06-21 01:05:41 +04:00
parent 0d1af0e276
commit f5ebc43e2d
1 changed files with 15 additions and 9 deletions

View File

@ -167,18 +167,24 @@ describe Project do
end end
end end
it '#run_mass_import' do context '#run_mass_import' do
before { WebMock.allow_net_connect! }
after { WebMock.disable_net_connect! }
it 'success' do
owner = FactoryGirl.create(:user) owner = FactoryGirl.create(:user)
repository = FactoryGirl.create(:repository) repository = FactoryGirl.create(:repository)
url = 'http://abf-downloads.rosalinux.ru/abf_personal/repository/test-mass-import' url = 'http://abf-downloads.rosalinux.ru/abf_personal/repository/test-mass-import'
visibility = 'open' visibility = 'open'
Project.run_mass_import(url, "abf-worker-service-1-3.src.rpm\nredir-2.2.1-7.res6.src.rpm\n", visibility, owner, repository.id) Project.run_mass_import(url, "abf-worker-service-1-3.src.rpm\nredir-2.2.1-7.res6.src.rpm\n", visibility, owner, repository.id)
Project.count.should == 2 Project.count.should == 2
repository.projects.should have(2).items repository.projects.should have(2).items
owner.projects.should have(2).items owner.projects.should have(2).items
end end
end
shared_examples_for 'autostart build_lists' do |once_a_12_hours, once_a_day, once_a_week| shared_examples_for 'autostart build_lists' do |once_a_12_hours, once_a_day, once_a_week|
it { lambda { Project.autostart_build_lists_once_a_12_hours }.should change{ BuildList.count }.by(once_a_12_hours) } it { lambda { Project.autostart_build_lists_once_a_12_hours }.should change{ BuildList.count }.by(once_a_12_hours) }