diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-01-05 12:29:01 +0100 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-01-05 12:29:01 +0100 |
commit | 5d1391b6818b61e3b7ba4742d6487382484f9643 (patch) | |
tree | 8bb6f514f4391bc91c2385d294772f8fbf854f2d /spec/models | |
parent | 176b60d11055999d56e30b6fe0581fbede2740c4 (diff) | |
download | gitlab-ce-5d1391b6818b61e3b7ba4742d6487382484f9643.tar.gz |
Fix specsremove-project-repo
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/namespace_spec.rb | 10 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 0678cae9b93..b3f160f3119 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -250,9 +250,13 @@ describe Namespace do parent.update(path: 'mygroup_new') - expect(project_in_parent_group.repo.config['gitlab.fullpath']).to eq "mygroup_new/#{project_in_parent_group.path}" - expect(hashed_project_in_subgroup.repo.config['gitlab.fullpath']).to eq "mygroup_new/mysubgroup/#{hashed_project_in_subgroup.path}" - expect(legacy_project_in_subgroup.repo.config['gitlab.fullpath']).to eq "mygroup_new/mysubgroup/#{legacy_project_in_subgroup.path}" + expect(project_rugged(project_in_parent_group).config['gitlab.fullpath']).to eq "mygroup_new/#{project_in_parent_group.path}" + expect(project_rugged(hashed_project_in_subgroup).config['gitlab.fullpath']).to eq "mygroup_new/mysubgroup/#{hashed_project_in_subgroup.path}" + expect(project_rugged(legacy_project_in_subgroup).config['gitlab.fullpath']).to eq "mygroup_new/mysubgroup/#{legacy_project_in_subgroup.path}" + end + + def project_rugged(project) + project.repository.rugged end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index cea22bbd184..8111365bed1 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2632,7 +2632,7 @@ describe Project do project.rename_repo - expect(project.repo.config['gitlab.fullpath']).to eq(project.full_path) + expect(project.repository.rugged.config['gitlab.fullpath']).to eq(project.full_path) end end @@ -2793,7 +2793,7 @@ describe Project do it 'updates project full path in .git/config' do project.rename_repo - expect(project.repo.config['gitlab.fullpath']).to eq(project.full_path) + expect(project.repository.rugged.config['gitlab.fullpath']).to eq(project.full_path) end end @@ -3162,13 +3162,13 @@ describe Project do it 'writes full path in .git/config when key is missing' do project.write_repository_config - expect(project.repo.config['gitlab.fullpath']).to eq project.full_path + expect(project.repository.rugged.config['gitlab.fullpath']).to eq project.full_path end it 'updates full path in .git/config when key is present' do project.write_repository_config(gl_full_path: 'old/path') - expect { project.write_repository_config }.to change { project.repo.config['gitlab.fullpath'] }.from('old/path').to(project.full_path) + expect { project.write_repository_config }.to change { project.repository.rugged.config['gitlab.fullpath'] }.from('old/path').to(project.full_path) end it 'does not raise an error with an empty repository' do |