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
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-31 15:08:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-31 15:08:09 +0300
commit0d0cddc9ce20c5a7d8a2723d0aa620ca184a711a (patch)
tree64f91b4d4ca74aa09d2a62ac5910820d087ed7cb /spec/lib
parent6044caed20964a70c1ac6c5a3365d567ed96dfde (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/feature/gitaly_spec.rb10
-rw-r--r--spec/lib/gitlab/git/tree_spec.rb9
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/feature/gitaly_spec.rb b/spec/lib/feature/gitaly_spec.rb
index afb522d05e1..08651c42276 100644
--- a/spec/lib/feature/gitaly_spec.rb
+++ b/spec/lib/feature/gitaly_spec.rb
@@ -32,5 +32,15 @@ describe Feature::Gitaly do
it { is_expected.to be_a(Hash) }
it { is_expected.to eq("gitaly-feature-mep-mep" => "true") }
+
+ context 'when table does not exist' do
+ before do
+ allow(::Gitlab::Database).to receive(:cached_table_exists?).and_return(false)
+ end
+
+ it 'returns an empty Hash' do
+ expect(subject).to eq({})
+ end
+ end
end
end
diff --git a/spec/lib/gitlab/git/tree_spec.rb b/spec/lib/gitlab/git/tree_spec.rb
index d82acad866c..b254dd3f036 100644
--- a/spec/lib/gitlab/git/tree_spec.rb
+++ b/spec/lib/gitlab/git/tree_spec.rb
@@ -39,7 +39,10 @@ describe Gitlab::Git::Tree, :seed_helper do
it { expect(dir.flat_path).to eq('encoding') }
context :subdir do
+ # rubocop: disable Rails/FindBy
+ # This is not ActiveRecord where..first
let(:subdir) { Gitlab::Git::Tree.where(repository, SeedRepo::Commit::ID, 'files').first }
+ # rubocop: enable Rails/FindBy
it { expect(subdir).to be_kind_of Gitlab::Git::Tree }
it { expect(subdir.id).to eq('a1e8f8d745cc87e3a9248358d9352bb7f9a0aeba') }
@@ -50,7 +53,10 @@ describe Gitlab::Git::Tree, :seed_helper do
end
context :subdir_file do
+ # rubocop: disable Rails/FindBy
+ # This is not ActiveRecord where..first
let(:subdir_file) { Gitlab::Git::Tree.where(repository, SeedRepo::Commit::ID, 'files/ruby').first }
+ # rubocop: enable Rails/FindBy
it { expect(subdir_file).to be_kind_of Gitlab::Git::Tree }
it { expect(subdir_file.id).to eq('7e3e39ebb9b2bf433b4ad17313770fbe4051649c') }
@@ -63,7 +69,10 @@ describe Gitlab::Git::Tree, :seed_helper do
context :flat_path do
let(:filename) { 'files/flat/path/correct/content.txt' }
let(:oid) { create_file(filename) }
+ # rubocop: disable Rails/FindBy
+ # This is not ActiveRecord where..first
let(:subdir_file) { Gitlab::Git::Tree.where(repository, oid, 'files/flat').first }
+ # rubocop: enable Rails/FindBy
let(:repository_rugged) { Rugged::Repository.new(File.join(SEED_STORAGE_PATH, TEST_REPO_PATH)) }
it { expect(subdir_file.flat_path).to eq('files/flat/path/correct') }