Commit d89fde84 authored by Luke Duncalfe's avatar Luke Duncalfe

Fix error in Projects::TransferService spec

There was an error in this spec where it would proove that the
repository full_path would not change, when the project was using
hashed storage.

The full_path does change, however the repository was memoized. When
the memoization is cleared via reload_repository! the spec would fail.
parent 01d2283e
...@@ -47,11 +47,12 @@ describe Projects::TransferService do ...@@ -47,11 +47,12 @@ describe Projects::TransferService do
end end
end end
it 'disk path has moved' do it 'moves the disk path', :aggregate_failures do
old_path = project.repository.disk_path old_path = project.repository.disk_path
old_full_path = project.repository.full_path old_full_path = project.repository.full_path
transfer_project(project, user, group) transfer_project(project, user, group)
project.reload_repository!
expect(project.repository.disk_path).not_to eq(old_path) expect(project.repository.disk_path).not_to eq(old_path)
expect(project.repository.full_path).not_to eq(old_full_path) expect(project.repository.full_path).not_to eq(old_full_path)
...@@ -304,16 +305,18 @@ describe Projects::TransferService do ...@@ -304,16 +305,18 @@ describe Projects::TransferService do
group.add_owner(user) group.add_owner(user)
end end
it 'does not move the directory' do it 'does not move the disk path', :aggregate_failures do
old_path = hashed_project.repository.disk_path old_disk_path = hashed_project.repository.disk_path
old_full_path = hashed_project.repository.full_path new_full_path = "#{group.full_path}/#{hashed_project.path}"
transfer_project(hashed_project, user, group) transfer_project(hashed_project, user, group)
project.reload hashed_project.reload_repository!
expect(hashed_project.repository.disk_path).to eq(old_path) expect(hashed_project.repository).to have_attributes(
expect(hashed_project.repository.full_path).to eq(old_full_path) disk_path: old_disk_path,
expect(hashed_project.disk_path).to eq(old_path) full_path: new_full_path
)
expect(hashed_project.disk_path).to eq(old_disk_path)
end end
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