Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
bc2d7091a547
Commit
bd9887e6
authored
Mar 01, 2017
by
Jose Ivan Vargas
Browse files
Fixed repository_controller_spec
also added an #open_branches private method
parent
5d015e30736d
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/projects/settings/repository_controller.rb
View file @
bc2d7091
...
...
@@ -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
...
...
spec/controllers/projects/settings/repository_controller_spec.rb
View file @
bc2d7091
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment