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
722a3829
Commit
722a3829
authored
Mar 02, 2022
by
Darby Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding controller spect to ensure permissions are enforced
parent
117ee702
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
13 deletions
+57
-13
app/assets/javascripts/ci_secure_files/components/secure_files_list.vue
...ascripts/ci_secure_files/components/secure_files_list.vue
+10
-7
app/views/projects/ci/secure_files/show.html.haml
app/views/projects/ci/secure_files/show.html.haml
+1
-1
spec/controllers/projects/ci/secure_files_controller_spec.rb
spec/controllers/projects/ci/secure_files_controller_spec.rb
+40
-0
spec/frontend/ci_secure_files/components/secure_files_list_spec.js
...tend/ci_secure_files/components/secure_files_list_spec.js
+6
-5
No files found.
app/assets/javascripts/ci_secure_files/components/secure_files_list.vue
View file @
722a3829
...
...
@@ -21,6 +21,11 @@ export default {
next
:
__
(
'
Next
'
),
prev
:
__
(
'
Prev
'
),
},
title
:
__
(
'
Secure Files
'
),
overviewMessage
:
__
(
'
Use Secure Files to store files used by your pipelines such as Android keystores, or Apple provisioning profiles and signing certificates.
'
,
),
moreInformation
:
__
(
'
More information
'
),
},
data
()
{
return
{
...
...
@@ -74,16 +79,14 @@ export default {
<
template
>
<div>
<h1
data-testid=
"title"
class=
"gl-font-size-h1 gl-mt-3 gl-mb-0"
>
{{
__
(
'
Secure Files
'
)
}}
</h1>
<h1
data-testid=
"title"
class=
"gl-font-size-h1 gl-mt-3 gl-mb-0"
>
{{
$options
.
i18n
.
title
}}
</h1>
<p>
<span
data-testid=
"info-message"
class=
"gl-mr-2"
>
{{
__
(
'
Use Secure Files to store files used by your pipelines such as Android keystores, or Apple provisioning profiles and signing certificates.
'
,
)
}}
<gl-link
:href=
"$options.docsLink"
target=
"_blank"
>
{{
__
(
'
More information
'
)
}}
</gl-link>
{{
$options
.
i18n
.
overviewMessage
}}
<gl-link
:href=
"$options.docsLink"
target=
"_blank"
>
{{
$options
.
i18n
.
moreInformation
}}
</gl-link>
</span>
</p>
...
...
app/views/projects/ci/secure_files/show.html.haml
View file @
722a3829
-
@content_class
=
"limit-container-width"
-
page_title
s_
(
'
Pipelines|
Secure Files'
)
-
page_title
s_
(
'Secure Files'
)
#js-ci-secure-files
{
data:
{
project_id:
@project
.
id
}
}
spec/controllers/projects/ci/secure_files_controller_spec.rb
0 → 100644
View file @
722a3829
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
Ci
::
SecureFilesController
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
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
project
.
add_developer
(
user
)
show_request
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
}
it
'renders show page'
do
expect
(
response
).
to
render_template
:show
end
end
context
'without enough privileges'
do
before
do
project
.
add_reporter
(
user
)
show_request
end
it
'responds with 404'
do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
end
spec/frontend/ci_secure_files/components/secure_files_list_spec.js
View file @
722a3829
...
...
@@ -4,6 +4,7 @@ import { mount } from '@vue/test-utils';
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
SecureFilesList
from
'
~/ci_secure_files/components/secure_files_list.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
secureFiles
}
from
'
../mock_data
'
;
...
...
@@ -52,7 +53,7 @@ describe('SecureFilesList', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
secureFiles
);
createWrapper
();
await
axios
.
waitForAll
();
await
waitForPromises
();
});
it
(
'
displays a table with expected headers
'
,
()
=>
{
...
...
@@ -79,7 +80,7 @@ describe('SecureFilesList', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
[]);
createWrapper
();
await
axios
.
waitForAll
();
await
waitForPromises
();
});
it
(
'
displays a table with expected headers
'
,
()
=>
{
...
...
@@ -100,7 +101,7 @@ describe('SecureFilesList', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
secureFiles
,
{
'
x-total
'
:
30
});
createWrapper
();
await
axios
.
waitForAll
();
await
waitForPromises
();
expect
(
findPagination
().
exists
()).
toBe
(
true
);
});
...
...
@@ -110,7 +111,7 @@ describe('SecureFilesList', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
secureFiles
,
{
'
x-total
'
:
20
});
createWrapper
();
await
axios
.
waitForAll
();
await
waitForPromises
();
expect
(
findPagination
().
exists
()).
toBe
(
false
);
});
...
...
@@ -130,7 +131,7 @@ describe('SecureFilesList', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
secureFiles
);
createWrapper
();
await
axios
.
waitForAll
();
await
waitForPromises
();
expect
(
findLoadingIcon
().
exists
()).
toBe
(
false
);
});
...
...
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