Commit d10ee385 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'better-spec-services-geo' into 'master'

Refactors Geo::RepositoryVerificationPrimaryService spec to remove repeated example

See merge request gitlab-org/gitlab!28525
parents ac6e297e 8976096d
......@@ -403,4 +403,3 @@ RSpec/RepeatedExample:
- 'spec/rubocop/cop/migration/update_large_table_spec.rb'
- 'spec/services/notification_service_spec.rb'
- 'spec/services/web_hook_service_spec.rb'
- 'ee/spec/services/geo/repository_verification_primary_service_spec.rb'
---
title: Improved tests by removing duplicated specs
merge_request: 28525
author: Leandro Silva
type: other
......@@ -32,41 +32,16 @@ describe Geo::RepositoryVerificationPrimaryService do
)
end
it 'calculates the checksum for outdated projects' do
stub_project_repository(project, repository)
stub_wiki_repository(project.wiki, wiki)
repository_state =
create(:repository_state,
project: project,
repository_verification_checksum: nil,
wiki_verification_checksum: nil)
subject.execute
expect(repository_state.reload).to have_attributes(
repository_verification_checksum: 'f123',
last_repository_verification_ran_at: be_present,
last_repository_verification_failure: nil,
wiki_verification_checksum: 'e321',
last_wiki_verification_ran_at: be_present,
last_wiki_verification_failure: nil,
repository_retry_at: nil,
repository_retry_count: nil,
wiki_retry_at: nil,
wiki_retry_count: nil
)
end
it 'calculates the checksum for outdated repositories/wikis' do
stub_project_repository(project, repository)
stub_wiki_repository(project.wiki, wiki)
repository_state =
create(:repository_state,
project: project,
repository_verification_checksum: nil,
wiki_verification_checksum: nil)
:repository_outdated,
:wiki_outdated,
project: project
)
subject.execute
......
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