Commit f2e6aec0 authored by Thong Kuah's avatar Thong Kuah

Remove un-used methods

These two methods were used in emitting AUTO_DEVOPS_DOMAIN which has now
been dropped.
parent f0efa2f9
...@@ -16,14 +16,6 @@ class ProjectAutoDevops < ApplicationRecord ...@@ -16,14 +16,6 @@ class ProjectAutoDevops < ApplicationRecord
after_save :create_gitlab_deploy_token, if: :needs_to_create_deploy_token? after_save :create_gitlab_deploy_token, if: :needs_to_create_deploy_token?
def instance_domain
Gitlab::CurrentSettings.auto_devops_domain
end
def has_domain?
domain.present? || instance_domain.present?
end
def predefined_variables def predefined_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables| Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.concat(deployment_strategy_default_variables) variables.concat(deployment_strategy_default_variables)
......
...@@ -14,34 +14,6 @@ describe ProjectAutoDevops do ...@@ -14,34 +14,6 @@ describe ProjectAutoDevops do
it { is_expected.to respond_to(:created_at) } it { is_expected.to respond_to(:created_at) }
it { is_expected.to respond_to(:updated_at) } it { is_expected.to respond_to(:updated_at) }
describe '#has_domain?' do
context 'when domain is defined' do
let(:auto_devops) { build_stubbed(:project_auto_devops, project: project, domain: 'domain.com') }
it { expect(auto_devops).to have_domain }
end
context 'when domain is empty' do
let(:auto_devops) { build_stubbed(:project_auto_devops, project: project, domain: '') }
context 'when there is an instance domain specified' do
before do
allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return('example.com')
end
it { expect(auto_devops).to have_domain }
end
context 'when there is no instance domain specified' do
before do
allow(Gitlab::CurrentSettings).to receive(:auto_devops_domain).and_return(nil)
end
it { expect(auto_devops).not_to have_domain }
end
end
end
describe '#predefined_variables' do describe '#predefined_variables' do
let(:auto_devops) { build_stubbed(:project_auto_devops, project: project, domain: domain) } let(:auto_devops) { build_stubbed(:project_auto_devops, project: project, domain: domain) }
......
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