Commit 0a6816eb authored by Matija Čupić's avatar Matija Čupić

Use Gitlab::CurrentSettings instead of current_application_settings

parent 6214d523
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?
......
......@@ -75,8 +75,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
......
......@@ -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) }
......
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