2020-05-24 23:13:21 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
RSpec.describe DesignManagement::Repository, feature_category: :design_management do
|
|
|
|
let_it_be(:project) { create(:project) }
|
2023-07-09 08:55:56 +05:30
|
|
|
let(:subject) { described_class.new({ project: project }) }
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
describe 'associations' do
|
|
|
|
it { is_expected.to belong_to(:project).inverse_of(:design_management_repository) }
|
2020-05-24 23:13:21 +05:30
|
|
|
end
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
describe 'validations' do
|
|
|
|
it { is_expected.to validate_presence_of(:project) }
|
|
|
|
it { is_expected.to validate_uniqueness_of(:project) }
|
2020-05-24 23:13:21 +05:30
|
|
|
end
|
2023-07-09 08:55:56 +05:30
|
|
|
|
|
|
|
it "returns the project's full path" do
|
|
|
|
expect(subject.full_path).to eq(project.full_path + Gitlab::GlRepository::DESIGN.path_suffix)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "returns the project's disk path" do
|
|
|
|
expect(subject.disk_path).to eq(project.disk_path + Gitlab::GlRepository::DESIGN.path_suffix)
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
end
|