diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-10 20:27:43 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-06 18:47:44 +0300 |
commit | 336b818bcbcb070968f825f6a426e046a457d556 (patch) | |
tree | 5c4b2c2c4b1d0655dd14acb373d8a3dde153880e /app/controllers | |
parent | c4f09f23c7228341d97c45e44612a513c70c5ed9 (diff) |
Added access spec tests
Also created changelog and removed redundant code
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/protected_branches_controller.rb | 17 | ||||
-rw-r--r-- | app/controllers/projects/settings/repository_controller.rb | 2 |
2 files changed, 1 insertions, 18 deletions
diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index ac886f0739a..1c22b9c2ca8 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -1,5 +1,4 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController - include RepositoryHelper # Authorize before_action :require_non_empty_project before_action :authorize_admin_project! @@ -61,20 +60,4 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController def load_protected_branches @protected_branches = @project.protected_branches.order(:name).page(params[:page]) end - - def access_levels_options - { - push_access_levels: { - "Roles" => ProtectedBranch::PushAccessLevel.human_access_levels.map { |id, text| { id: id, text: text, before_divider: true } }, - }, - merge_access_levels: { - "Roles" => ProtectedBranch::MergeAccessLevel.human_access_levels.map { |id, text| { id: id, text: text, before_divider: true } } - } - } - end - - def load_gon_index - params = { open_branches: @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } } } - gon.push(params.merge(access_levels_options)) - end end diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index 99a3756531f..a8c6a1b419c 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -21,7 +21,7 @@ module Projects def define_protected_branches_controller @protected_branch = @project.protected_branches.new - load_gon_index(@project) + load_gon_index end end end |