summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-02-01 21:29:37 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-02-02 17:59:09 -0500
commit4105f292e1c9d9c9416914fcd41f9c982b4a80fb (patch)
treeceb1b2943b15b28588350b9e5619dc10c45c4375 /spec/lib
parentc4c919e59ded2fbf29dc3085b6621e02c0b10f54 (diff)
downloadgitlab-ce-4105f292e1c9d9c9416914fcd41f9c982b4a80fb.tar.gz
Display database type and version in Administration dashboardrs-database-info
Closes #12900
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/database_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb
index 8461e8ce50d..bd8688fefa1 100644
--- a/spec/lib/gitlab/database_spec.rb
+++ b/spec/lib/gitlab/database_spec.rb
@@ -14,4 +14,24 @@ describe Gitlab::Database, lib: true do
it { is_expected.to satisfy { |val| val == true || val == false } }
end
+
+ describe '.version' do
+ context "on mysql" do
+ it "extracts the version number" do
+ allow(described_class).to receive(:database_version).
+ and_return("5.7.12-standard")
+
+ expect(described_class.version).to eq '5.7.12-standard'
+ end
+ end
+
+ context "on postgresql" do
+ it "extracts the version number" do
+ allow(described_class).to receive(:database_version).
+ and_return("PostgreSQL 9.4.4 on x86_64-apple-darwin14.3.0")
+
+ expect(described_class.version).to eq '9.4.4'
+ end
+ end
+ end
end