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
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-04 06:16:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-04 06:16:09 +0300
commit242358bb7b8e031b9b975340750be33b19015cfa (patch)
tree55cf5342bc232ba517698a1f82e859d5fdf25fac /spec/lib
parent517f254952ababb661160d3afd659902d18e29cd (diff)
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/current_settings_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/current_settings_spec.rb b/spec/lib/gitlab/current_settings_spec.rb
index fd4e8bc1cd0..786db23ffc4 100644
--- a/spec/lib/gitlab/current_settings_spec.rb
+++ b/spec/lib/gitlab/current_settings_spec.rb
@@ -115,6 +115,16 @@ RSpec.describe Gitlab::CurrentSettings do
expect(settings).to have_attributes(settings_from_defaults)
end
+ context 'when ApplicationSettings does not have a primary key' do
+ before do
+ allow(ActiveRecord::Base.connection).to receive(:primary_key).with('application_settings').and_return(nil)
+ end
+
+ it 'raises an exception if ApplicationSettings does not have a primary key' do
+ expect { described_class.current_application_settings }.to raise_error(/table is missing a primary key constraint/)
+ end
+ end
+
context 'with pending migrations' do
let(:current_settings) { described_class.current_application_settings }