2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe Gitlab::ImportExport do
|
2016-08-24 12:49:21 +05:30
|
|
|
describe 'export filename' do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:group) { create(:group, :nested) }
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:project) { create(:project, :public, path: 'project-path', namespace: group) }
|
2016-08-24 12:49:21 +05:30
|
|
|
|
|
|
|
it 'contains the project path' do
|
2019-12-26 22:10:19 +05:30
|
|
|
expect(described_class.export_filename(exportable: project)).to include(project.path)
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'contains the namespace path' do
|
2019-12-26 22:10:19 +05:30
|
|
|
expect(described_class.export_filename(exportable: project)).to include(project.namespace.full_path.tr('/', '_'))
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not go over a certain length' do
|
|
|
|
project.path = 'a' * 100
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
expect(described_class.export_filename(exportable: project).length).to be < 70
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|