Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/variables_controller.rb6
-rw-r--r--app/presenters/ci/variable_presenter.rb4
-rw-r--r--spec/presenters/ci/variable_presenter_spec.rb8
3 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index e8dcfa92348..a7fd4c2657c 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -5,7 +5,7 @@ class Projects::VariablesController < Projects::ApplicationController
layout 'project_settings'
def index
- redirect_to namespace_project_settings_ci_cd_path(@project.namespace, @project)
+ redirect_to project_settings_ci_cd_path(@project)
end
def show
@@ -34,11 +34,11 @@ class Projects::VariablesController < Projects::ApplicationController
def destroy
if variable.destroy
- redirect_to namespace_project_settings_ci_cd_path(project.namespace, project),
+ redirect_to project_settings_ci_cd_path(project),
status: 302,
notice: 'Variable was successfully removed.'
else
- redirect_to namespace_project_settings_ci_cd_path(project.namespace, project),
+ redirect_to project_settings_ci_cd_path(project),
status: 302,
notice: 'Failed to remove the variable.'
end
diff --git a/app/presenters/ci/variable_presenter.rb b/app/presenters/ci/variable_presenter.rb
index 710604c653c..5d7998393a6 100644
--- a/app/presenters/ci/variable_presenter.rb
+++ b/app/presenters/ci/variable_presenter.rb
@@ -8,9 +8,9 @@ module Ci
def form_path
if variable.persisted?
- namespace_project_variable_path(project.namespace, project, variable)
+ project_variable_path(project, variable)
else
- namespace_project_variables_path(project.namespace, project)
+ project_variables_path(project)
end
end
diff --git a/spec/presenters/ci/variable_presenter_spec.rb b/spec/presenters/ci/variable_presenter_spec.rb
index 3b615c4bf36..9e6aae7bcad 100644
--- a/spec/presenters/ci/variable_presenter_spec.rb
+++ b/spec/presenters/ci/variable_presenter_spec.rb
@@ -38,26 +38,26 @@ describe Ci::VariablePresenter do
context 'when variable is persisted' do
subject { described_class.new(variable).form_path }
- it { is_expected.to eq(namespace_project_variable_path(project.namespace, project, variable)) }
+ it { is_expected.to eq(project_variable_path(project, variable)) }
end
context 'when variable is not persisted' do
let(:variable) { build(:ci_variable, project: project) }
subject { described_class.new(variable).form_path }
- it { is_expected.to eq(namespace_project_variables_path(project.namespace, project)) }
+ it { is_expected.to eq(project_variables_path(project)) }
end
end
describe '#edit_path' do
subject { described_class.new(variable).edit_path }
- it { is_expected.to eq(namespace_project_variable_path(project.namespace, project, variable)) }
+ it { is_expected.to eq(project_variable_path(project, variable)) }
end
describe '#delete_path' do
subject { described_class.new(variable).delete_path }
- it { is_expected.to eq(namespace_project_variable_path(project.namespace, project, variable)) }
+ it { is_expected.to eq(project_variable_path(project, variable)) }
end
end