diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-02-03 01:56:11 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-03 12:20:59 +0100 |
commit | 56bcb3e8c87bf25cb33ed02832c146e966cc4d7d (patch) | |
tree | bb8aadd524ab052da693ef28e0cfc390024edb70 | |
parent | bf278f791b0f112c79e8cdeaa82db91ae2af4fe4 (diff) | |
download | gitlab-ce-56bcb3e8c87bf25cb33ed02832c146e966cc4d7d.tar.gz |
Use Gitlab::CurrentSettings instead of current_application_settings
-rw-r--r-- | app/models/project_auto_devops.rb | 4 | ||||
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_auto_devops_spec.rb | 8 |
3 files changed, 7 insertions, 9 deletions
diff --git a/app/models/project_auto_devops.rb b/app/models/project_auto_devops.rb index f23310e854a..728e64e8fe3 100644 --- a/app/models/project_auto_devops.rb +++ b/app/models/project_auto_devops.rb @@ -1,6 +1,4 @@ class ProjectAutoDevops < ActiveRecord::Base - include Gitlab::CurrentSettings - belongs_to :project scope :enabled, -> { where(enabled: true) } @@ -9,7 +7,7 @@ class ProjectAutoDevops < ActiveRecord::Base validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true } def instance_domain - current_application_settings.auto_devops_domain + Gitlab::CurrentSettings.auto_devops_domain end def has_domain? diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 3da2f4e2fdb..39b213988f0 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -52,8 +52,8 @@ feature 'Admin updates settings' do fill_in 'Auto devops domain', with: 'domain.com' click_button 'Save' - expect(current_application_settings.auto_devops_enabled?).to be true - expect(current_application_settings.auto_devops_domain).to eq('domain.com') + expect(Gitlab::CurrentSettings.auto_devops_enabled?).to be true + expect(Gitlab::CurrentSettings.auto_devops_domain).to eq('domain.com') expect(page).to have_content "Application settings saved successfully" end diff --git a/spec/models/project_auto_devops_spec.rb b/spec/models/project_auto_devops_spec.rb index de90080b4b8..296b91a771c 100644 --- a/spec/models/project_auto_devops_spec.rb +++ b/spec/models/project_auto_devops_spec.rb @@ -20,7 +20,7 @@ describe ProjectAutoDevops do context 'when there is an instance domain specified' do before do - stub_application_setting(auto_devops_domain: 'example.com') + allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return('example.com') end it { expect(auto_devops).to have_domain } @@ -28,7 +28,7 @@ describe ProjectAutoDevops do context 'when there is no instance domain specified' do before do - stub_application_setting(auto_devops_domain: nil) + allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return(nil) end it { expect(auto_devops).not_to have_domain } @@ -52,7 +52,7 @@ describe ProjectAutoDevops do context 'when there is an instance domain specified' do before do - stub_application_setting(auto_devops_domain: 'example.com') + allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return('example.com') end it { expect(auto_devops.variables).to include(domain_variable) } @@ -60,7 +60,7 @@ describe ProjectAutoDevops do context 'when there is no instance domain specified' do before do - stub_application_setting(auto_devops_domain: nil) + allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return(nil) end it { expect(auto_devops.variables).not_to include(domain_variable) } |