Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
7b3ea49a
Commit
7b3ea49a
authored
Jan 18, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests and a rubocop linter
parent
0af99433
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
app/controllers/projects/hooks_controller.rb
app/controllers/projects/hooks_controller.rb
+2
-4
spec/features/security/project/internal_access_spec.rb
spec/features/security/project/internal_access_spec.rb
+2
-2
spec/features/security/project/private_access_spec.rb
spec/features/security/project/private_access_spec.rb
+2
-2
spec/features/security/project/public_access_spec.rb
spec/features/security/project/public_access_spec.rb
+2
-2
No files found.
app/controllers/projects/hooks_controller.rb
View file @
7b3ea49a
...
...
@@ -10,13 +10,11 @@ class Projects::HooksController < Projects::ApplicationController
@hook
=
@project
.
hooks
.
new
(
hook_params
)
@hook
.
save
if
@hook
.
valid?
redirect_to
namespace_project_settings_integrations_path
(
@project
.
namespace
,
@project
)
else
unless
@hook
.
valid?
@hooks
=
@project
.
hooks
.
select
(
&
:persisted?
)
flash
[
:alert
]
=
@hook
.
errors
.
full_messages
.
join
.
html_safe
redirect_to
namespace_project_settings_integrations_path
(
@project
.
namespace
,
@project
)
end
redirect_to
namespace_project_settings_integrations_path
(
@project
.
namespace
,
@project
)
end
def
test
...
...
spec/features/security/project/internal_access_spec.rb
View file @
7b3ea49a
...
...
@@ -262,8 +262,8 @@ describe "Internal Project Access", feature: true do
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
end
describe
"GET /:project_path/
hook
s"
do
subject
{
namespace_project_
hook
s_path
(
project
.
namespace
,
project
)
}
describe
"GET /:project_path/
settings/integration
s"
do
subject
{
namespace_project_
settings_integration
s_path
(
project
.
namespace
,
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
spec/features/security/project/private_access_spec.rb
View file @
7b3ea49a
...
...
@@ -234,8 +234,8 @@ describe "Private Project Access", feature: true do
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
end
describe
"GET /:project_path/hooks"
do
subject
{
namespace_project_
hook
s_path
(
project
.
namespace
,
project
)
}
describe
"GET /:project_path/
namespace/
hooks"
do
subject
{
namespace_project_
settings_integration
s_path
(
project
.
namespace
,
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
spec/features/security/project/public_access_spec.rb
View file @
7b3ea49a
...
...
@@ -400,8 +400,8 @@ describe "Public Project Access", feature: true do
it
{
is_expected
.
to
be_allowed_for
(
:visitor
)
}
end
describe
"GET /:project_path/
hook
s"
do
subject
{
namespace_project_
hook
s_path
(
project
.
namespace
,
project
)
}
describe
"GET /:project_path/
settings/integration
s"
do
subject
{
namespace_project_
settings_integration
s_path
(
project
.
namespace
,
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
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