Commit bd9887e6 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Fixed repository_controller_spec

also added an #open_branches private method
parent 43958926
...@@ -5,7 +5,7 @@ module Projects ...@@ -5,7 +5,7 @@ module Projects
def show def show
@deploy_keys = DeployKeysPresenter @deploy_keys = DeployKeysPresenter
.new(@project, current_user: @current_user) .new(@project, current_user: current_user)
define_protected_branches define_protected_branches
end end
...@@ -37,10 +37,13 @@ module Projects ...@@ -37,10 +37,13 @@ module Projects
} }
end end
def open_branches
branches = @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } }
{ open_branches: branches }
end
def load_gon_index def load_gon_index
open_branches = @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } } gon.push(open_branches.merge(access_levels_options))
params = { open_branches: open_branches }
gon.push(params.merge(access_levels_options))
end end
end end
end end
......
require 'spec_helper' require 'spec_helper'
describe Projects::Settings::RepositoryController do describe Projects::Settings::RepositoryController do
let(:project) { create(:empty_project, :public) } let(:project) { create(:project_empty_repo, :public) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
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