diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-03-21 23:05:01 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-03-22 01:03:26 +0300 |
commit | a86f48c79b3d4b03279be0132e2a4eeadd5e22dc (patch) | |
tree | 4ae3fe1c55037d2b8502a7f2a495ab992b0a877d /spec/lib/gitlab/database_spec.rb | |
parent | 134df14c1c327a53668eb5b6c1ece9fb33a00caa (diff) |
Add helper method to return a human-friendly name for database adapter
Diffstat (limited to 'spec/lib/gitlab/database_spec.rb')
-rw-r--r-- | spec/lib/gitlab/database_spec.rb | 14 |
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 |