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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 15:07:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 15:07:47 +0300
commit96b0c1245c93585a8b0fe23e22306d32ff4e4905 (patch)
treed2904751e1a2529e8239381ce747339cdbf5116c /spec/lib/gitlab/database_spec.rb
parent0ba3a054d2190094ffda1ebe3aa53ffc5b92247d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/database_spec.rb')
-rw-r--r--spec/lib/gitlab/database_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb
index 3db8900ed8e..4a0eab3ea27 100644
--- a/spec/lib/gitlab/database_spec.rb
+++ b/spec/lib/gitlab/database_spec.rb
@@ -396,6 +396,20 @@ describe Gitlab::Database do
end
end
+ describe '.exists?' do
+ it 'returns true if `ActiveRecord::Base.connection` succeeds' do
+ expect(ActiveRecord::Base).to receive(:connection)
+
+ expect(described_class.exists?).to be(true)
+ end
+
+ it 'returns false if `ActiveRecord::Base.connection` fails' do
+ expect(ActiveRecord::Base).to receive(:connection) { raise ActiveRecord::NoDatabaseError, 'broken' }
+
+ expect(described_class.exists?).to be(false)
+ end
+ end
+
describe '#true_value' do
it 'returns correct value' do
expect(described_class.true_value).to eq "'t'"