Use Gitlab::CurrentSettings instead of current_application_settings
This commit is contained in:
parent
bf278f791b
commit
56bcb3e8c8
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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) }
|
||||
|
|
Loading…
Reference in New Issue