Commit 78cd1963 authored by James Lopez's avatar James Lopez

fix avatar uploader error

parent fab15563
...@@ -19,7 +19,7 @@ class AvatarUploader < GitlabUploader ...@@ -19,7 +19,7 @@ class AvatarUploader < GitlabUploader
end end
def absolute_path def absolute_path
self.class.absolute_path(model.avatar) self.class.absolute_path(model.avatar.upload)
end end
private private
......
...@@ -35,5 +35,13 @@ describe AvatarUploader do ...@@ -35,5 +35,13 @@ describe AvatarUploader do
it_behaves_like "migrates", to_store: described_class::Store::REMOTE it_behaves_like "migrates", to_store: described_class::Store::REMOTE
it_behaves_like "migrates", from_store: described_class::Store::REMOTE, to_store: described_class::Store::LOCAL it_behaves_like "migrates", from_store: described_class::Store::REMOTE, to_store: described_class::Store::LOCAL
it 'sets the right absolute path' do
storage_path = Gitlab.config.uploads.storage_path
absolute_path = File.join(storage_path, upload.path)
expect(uploader.absolute_path.scan(storage_path).size).to eq(1)
expect(uploader.absolute_path).to eq(absolute_path)
end
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