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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
406444b4
Commit
406444b4
authored
Mar 07, 2022
by
Darby Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated secure_files_controller specs
parent
972a96d1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
app/controllers/projects/ci/secure_files_controller.rb
app/controllers/projects/ci/secure_files_controller.rb
+1
-1
spec/controllers/projects/ci/secure_files_controller_spec.rb
spec/controllers/projects/ci/secure_files_controller_spec.rb
+14
-5
spec/features/projects/ci/secure_files_spec.rb
spec/features/projects/ci/secure_files_spec.rb
+19
-0
No files found.
app/controllers/projects/ci/secure_files_controller.rb
View file @
406444b4
...
...
@@ -11,6 +11,6 @@ class Projects::Ci::SecureFilesController < Projects::ApplicationController
private
def
check_can_collaborate!
render_404
unless
can_collaborate_with_project?
(
@
project
)
render_404
unless
can_collaborate_with_project?
(
project
)
end
end
spec/controllers/projects/ci/secure_files_controller_spec.rb
View file @
406444b4
...
...
@@ -3,18 +3,15 @@
require
'spec_helper'
RSpec
.
describe
Projects
::
Ci
::
SecureFilesController
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
subject
(
:show_request
)
{
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
before
do
sign_in
(
user
)
end
describe
'GET #show'
do
context
'with enough privileges'
do
before
do
sign_in
(
user
)
project
.
add_developer
(
user
)
show_request
end
...
...
@@ -28,6 +25,7 @@ RSpec.describe Projects::Ci::SecureFilesController do
context
'without enough privileges'
do
before
do
sign_in
(
user
)
project
.
add_reporter
(
user
)
show_request
end
...
...
@@ -36,5 +34,16 @@ RSpec.describe Projects::Ci::SecureFilesController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'an unauthenticated user'
do
before
do
show_request
end
it
'redirects to sign in'
do
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
expect
(
response
).
to
redirect_to
(
'/users/sign_in'
)
end
end
end
end
spec/features/projects/ci/secure_files_spec.rb
0 → 100644
View file @
406444b4
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Secure Files'
,
:js
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
visit
project_ci_secure_files_path
(
project
)
end
it
'user sees the Secure Files list component'
do
expect
(
page
).
to
have_content
(
'There are no records to show'
)
end
end
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