Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2018-11-29 19:08:14 +0300
committerNick Thomas <nick@gitlab.com>2018-11-29 19:08:14 +0300
commit198fdc54789dcb24efb0622a23e6931d83e1faa6 (patch)
tree82c4d1926bd246fb857bb5ad9adaf68c45982dd5 /spec/models/project_repository_spec.rb
parent6775dafa3816239f6fa1b12428df42572be5a158 (diff)
Store hashed storage paths in the database
Diffstat (limited to 'spec/models/project_repository_spec.rb')
-rw-r--r--spec/models/project_repository_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/models/project_repository_spec.rb b/spec/models/project_repository_spec.rb
new file mode 100644
index 00000000000..c966447fedc
--- /dev/null
+++ b/spec/models/project_repository_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe ProjectRepository do
+ describe 'associations' do
+ it { is_expected.to belong_to(:shard) }
+ it { is_expected.to belong_to(:project) }
+ end
+
+ describe '.find_project' do
+ it 'finds project by disk path' do
+ project = create(:project)
+ project.track_project_repository
+
+ expect(described_class.find_project(project.disk_path)).to eq(project)
+ end
+
+ it 'returns nil when it does not find the project' do
+ expect(described_class.find_project('@@unexisting/path/to/project')).to be_nil
+ end
+ end
+end