summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-22 03:56:01 +0000
committerStan Hu <stanhu@gmail.com>2019-03-22 03:56:01 +0000
commit21a8079a01b791aab6f152753ad7078a6b2fd65c (patch)
tree5bcde0b4dbe57ccc3048830e2f6b195229ad8d50 /spec
parent8e3322b49cddebdc7280fee35a1d3d5985607c0b (diff)
parenta86f48c79b3d4b03279be0132e2a4eeadd5e22dc (diff)
downloadgitlab-ce-21a8079a01b791aab6f152753ad7078a6b2fd65c.tar.gz
Merge branch 'da-capitalize-db-apapter-name-on-rails-console' into 'master'
Display the database adapter name in a human-friendly way See merge request gitlab-org/gitlab-ce!26437
Diffstat (limited to 'spec')
-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 ae50abd0e7a..5f57cd6b825 100644
--- a/spec/lib/gitlab/database_spec.rb
+++ b/spec/lib/gitlab/database_spec.rb
@@ -17,6 +17,20 @@ describe Gitlab::Database do
end
end
+ describe '.human_adapter_name' do
+ it 'returns PostgreSQL when using PostgreSQL' do
+ allow(described_class).to receive(:postgresql?).and_return(true)
+
+ expect(described_class.human_adapter_name).to eq('PostgreSQL')
+ end
+
+ it 'returns MySQL when using MySQL' do
+ allow(described_class).to receive(:postgresql?).and_return(false)
+
+ expect(described_class.human_adapter_name).to eq('MySQL')
+ end
+ end
+
# These are just simple smoke tests to check if the methods work (regardless
# of what they may return).
describe '.mysql?' do