6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainenrequire 'spec_helper'
dc9de21d4375faeedbe5b7e941502ac578650da9Timo Sirainen subject! { create :repository_with_empty_remote }
ccffb125d94adff0ad776de5a96e22f864d6fb0aTimo Sirainen shared_examples 'perform' do |state, minutes, created_jobs_count|
636ece98e31017f94940d1f09c780cab36180e79Timo Sirainen (minutes ? "#{minutes} minutes ago" : 'never before')) do
6c2c5f20760b06bfb4a40b0ee2ef5ab016bc41f0Timo Sirainen imported_at: (minutes ? minutes.minutes.ago : nil)},
0371406d952fe51367c7be91703e5634b7d9d225Timo Sirainen it("should create #{created_jobs_count} jobs") do
0371406d952fe51367c7be91703e5634b7d9d225Timo Sirainen expect(RepositoryFetchingWorker.jobs.count).to eq(created_jobs_count)
0371406d952fe51367c7be91703e5634b7d9d225Timo Sirainen include_examples 'perform', :processing, nil, 0
0371406d952fe51367c7be91703e5634b7d9d225Timo Sirainen include_examples 'perform', :processing, 20, 0