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

Fixed repository_controller_spec

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