Commit c1f45237 authored by Valery Sizov's avatar Valery Sizov

Geo: Fix static analysis

parent c5baa30f
...@@ -42,7 +42,7 @@ describe Geo::ProjectRegistry do ...@@ -42,7 +42,7 @@ describe Geo::ProjectRegistry do
it 'returns projects that should be synced' do it 'returns projects that should be synced' do
create(:geo_project_registry, repository_retry_at: Date.yesterday, wiki_retry_at: Date.yesterday) create(:geo_project_registry, repository_retry_at: Date.yesterday, wiki_retry_at: Date.yesterday)
tomorrow = create(:geo_project_registry, repository_retry_at: Date.tomorrow, wiki_retry_at: Date.tomorrow) tomorrow = create(:geo_project_registry, repository_retry_at: Date.tomorrow, wiki_retry_at: Date.tomorrow)
not_set_retry_at = create(:geo_project_registry) create(:geo_project_registry)
expect(described_class.retry_due).not_to include(tomorrow) expect(described_class.retry_due).not_to include(tomorrow)
end end
......
...@@ -162,29 +162,30 @@ describe Geo::RepositorySyncService do ...@@ -162,29 +162,30 @@ describe Geo::RepositorySyncService do
context 'retries' do context 'retries' do
it 'tries to fetch repo' do it 'tries to fetch repo' do
registry = create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD - 1) create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD - 1)
expect_any_instance_of(Geo::RepositorySyncService).to receive(:fetch_project_repository).with(false) expect_any_instance_of(described_class).to receive(:fetch_project_repository).with(false)
subject.execute subject.execute
end end
it 'tries to redownload repo' do it 'tries to redownload repo' do
registry = create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD + 1) create(:geo_project_registry, project: project, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD + 1)
expect_any_instance_of(Geo::RepositorySyncService).to receive(:fetch_project_repository).with(true) expect_any_instance_of(described_class).to receive(:fetch_project_repository).with(true)
subject.execute subject.execute
end end
it 'tries to redownload repo when force_redownload flag is set' do it 'tries to redownload repo when force_redownload flag is set' do
registry = create(:geo_project_registry, create(
:geo_project_registry,
project: project, project: project,
repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD - 1, repository_retry_count: Geo::BaseSyncService::RETRY_BEFORE_REDOWNLOAD - 1,
force_to_redownload_repository: true force_to_redownload_repository: true
) )
expect_any_instance_of(Geo::RepositorySyncService).to receive(:fetch_project_repository).with(true) expect_any_instance_of(described_class).to receive(:fetch_project_repository).with(true)
subject.execute subject.execute
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment