Commit 56bcb3e8 authored by Matija Čupić's avatar Matija Čupić

Use Gitlab::CurrentSettings instead of current_application_settings

parent bf278f79
class ProjectAutoDevops < ActiveRecord::Base class ProjectAutoDevops < ActiveRecord::Base
include Gitlab::CurrentSettings
belongs_to :project belongs_to :project
scope :enabled, -> { where(enabled: true) } scope :enabled, -> { where(enabled: true) }
...@@ -9,7 +7,7 @@ class ProjectAutoDevops < ActiveRecord::Base ...@@ -9,7 +7,7 @@ class ProjectAutoDevops < ActiveRecord::Base
validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true } validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }
def instance_domain def instance_domain
current_application_settings.auto_devops_domain Gitlab::CurrentSettings.auto_devops_domain
end end
def has_domain? def has_domain?
......
...@@ -52,8 +52,8 @@ feature 'Admin updates settings' do ...@@ -52,8 +52,8 @@ feature 'Admin updates settings' do
fill_in 'Auto devops domain', with: 'domain.com' fill_in 'Auto devops domain', with: 'domain.com'
click_button 'Save' click_button 'Save'
expect(current_application_settings.auto_devops_enabled?).to be true expect(Gitlab::CurrentSettings.auto_devops_enabled?).to be true
expect(current_application_settings.auto_devops_domain).to eq('domain.com') expect(Gitlab::CurrentSettings.auto_devops_domain).to eq('domain.com')
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
......
...@@ -20,7 +20,7 @@ describe ProjectAutoDevops do ...@@ -20,7 +20,7 @@ describe ProjectAutoDevops do
context 'when there is an instance domain specified' do context 'when there is an instance domain specified' do
before do before do
stub_application_setting(auto_devops_domain: 'example.com') allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return('example.com')
end end
it { expect(auto_devops).to have_domain } it { expect(auto_devops).to have_domain }
...@@ -28,7 +28,7 @@ describe ProjectAutoDevops do ...@@ -28,7 +28,7 @@ describe ProjectAutoDevops do
context 'when there is no instance domain specified' do context 'when there is no instance domain specified' do
before do before do
stub_application_setting(auto_devops_domain: nil) allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return(nil)
end end
it { expect(auto_devops).not_to have_domain } it { expect(auto_devops).not_to have_domain }
...@@ -52,7 +52,7 @@ describe ProjectAutoDevops do ...@@ -52,7 +52,7 @@ describe ProjectAutoDevops do
context 'when there is an instance domain specified' do context 'when there is an instance domain specified' do
before do before do
stub_application_setting(auto_devops_domain: 'example.com') allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return('example.com')
end end
it { expect(auto_devops.variables).to include(domain_variable) } it { expect(auto_devops.variables).to include(domain_variable) }
...@@ -60,7 +60,7 @@ describe ProjectAutoDevops do ...@@ -60,7 +60,7 @@ describe ProjectAutoDevops do
context 'when there is no instance domain specified' do context 'when there is no instance domain specified' do
before do before do
stub_application_setting(auto_devops_domain: nil) allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return(nil)
end end
it { expect(auto_devops.variables).not_to include(domain_variable) } it { expect(auto_devops.variables).not_to include(domain_variable) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment