summaryrefslogtreecommitdiff
path: root/spec/models/repository_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 03:07:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 03:07:46 +0000
commitb24ae1cbc66e5b0f622393bcf2c59711750161ea (patch)
treede9514fdda81f7d8293612687026a87826b0d9dd /spec/models/repository_spec.rb
parent775816e676aae53509d7b6f364945f2720636f72 (diff)
downloadgitlab-ce-b24ae1cbc66e5b0f622393bcf2c59711750161ea.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 661cbd14427..38f3777c902 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -1331,6 +1331,13 @@ describe Repository do
repository.root_ref
end
+ it 'returns nil if the repository does not exist' do
+ repository = create(:project).repository
+
+ expect(repository).not_to be_exists
+ expect(repository.root_ref).to be_nil
+ end
+
it_behaves_like 'asymmetric cached method', :root_ref
end