summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-01-05 15:00:42 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-01-05 15:00:42 +0000
commit7d6a0a215806cbcbd7e1918ad042d554e3b6459f (patch)
treeffe03da206b5f35afb680df2f59d902d39342181 /spec
parent780cc843df5c136184f11c9b86f57670d7fd1afb (diff)
parent5d1391b6818b61e3b7ba4742d6487382484f9643 (diff)
downloadgitlab-ce-7d6a0a215806cbcbd7e1918ad042d554e3b6459f.tar.gz
Merge branch 'remove-project-repo' into 'master'
Remove the Project#repo method See merge request gitlab-org/gitlab-ce!16238
Diffstat (limited to 'spec')
-rw-r--r--spec/models/namespace_spec.rb10
-rw-r--r--spec/models/project_spec.rb8
-rw-r--r--spec/services/projects/create_service_spec.rb2
-rw-r--r--spec/services/projects/hashed_storage/migrate_repository_service_spec.rb2
-rw-r--r--spec/services/projects/transfer_service_spec.rb4
5 files changed, 15 insertions, 11 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 3c2ed043b82..723677ce996 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
@@ -3143,13 +3143,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
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb
index 1833078f37c..9a44dfde41b 100644
--- a/spec/services/projects/create_service_spec.rb
+++ b/spec/services/projects/create_service_spec.rb
@@ -255,7 +255,7 @@ describe Projects::CreateService, '#execute' do
it 'writes project full path to .git/config' do
project = create_project(user, opts)
- expect(project.repo.config['gitlab.fullpath']).to eq project.full_path
+ expect(project.repository.rugged.config['gitlab.fullpath']).to eq project.full_path
end
def create_project(user, opts)
diff --git a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
index ded864beb1d..7b536cc05cb 100644
--- a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
+++ b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
@@ -37,7 +37,7 @@ describe Projects::HashedStorage::MigrateRepositoryService do
it 'writes project full path to .git/config' do
service.execute
- 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
diff --git a/spec/services/projects/transfer_service_spec.rb b/spec/services/projects/transfer_service_spec.rb
index 7377c748698..39f6388c25e 100644
--- a/spec/services/projects/transfer_service_spec.rb
+++ b/spec/services/projects/transfer_service_spec.rb
@@ -58,7 +58,7 @@ describe Projects::TransferService do
it 'updates project full path in .git/config' do
transfer_project(project, user, group)
- expect(project.repo.config['gitlab.fullpath']).to eq "#{group.full_path}/#{project.path}"
+ expect(project.repository.rugged.config['gitlab.fullpath']).to eq "#{group.full_path}/#{project.path}"
end
end
@@ -95,7 +95,7 @@ describe Projects::TransferService do
it 'rolls back project full path in .git/config' do
attempt_project_transfer
- 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 "doesn't send move notifications" do