diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-17 16:16:47 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-17 19:08:10 +0300 |
commit | 9a20ff1c99e0e73883d32438e50772635f0aed27 (patch) | |
tree | c99d875ffeba6bbb587d8c9e388d29036e040c97 /spec/lib/gitlab/database_spec.rb | |
parent | 7a623907528a77187e070c9721469df8bdd00ec8 (diff) |
Added Gitlab::Database.config
This returns the ActiveRecord configuration for the current environment.
While CE doesn't use this very often, EE will use it in a few places for
the database load balancing code. I'm adding this to CE so we don't end
up with merge conflicts in this file.
Diffstat (limited to 'spec/lib/gitlab/database_spec.rb')
-rw-r--r-- | spec/lib/gitlab/database_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index edd01d032c8..4ce4e6e1034 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -1,10 +1,16 @@ require 'spec_helper' -class MigrationTest - include Gitlab::Database -end - describe Gitlab::Database, lib: true do + before do + stub_const('MigrationTest', Class.new { include Gitlab::Database }) + end + + describe '.config' do + it 'returns a Hash' do + expect(described_class.config).to be_an_instance_of(Hash) + end + end + describe '.adapter_name' do it 'returns the name of the adapter' do expect(described_class.adapter_name).to be_an_instance_of(String) |