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
6a504c82
Commit
6a504c82
authored
9 years ago
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature tests for permissions for build artifacts read ability
parent
6b2f38f3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
12 deletions
+57
-12
features/project/builds/artifacts.feature
features/project/builds/artifacts.feature
+2
-2
features/project/builds/permissions.feature
features/project/builds/permissions.feature
+18
-0
features/project/builds/summary.feature
features/project/builds/summary.feature
+2
-2
features/steps/project/builds/artifacts.rb
features/steps/project/builds/artifacts.rb
+0
-5
features/steps/project/builds/permissions.rb
features/steps/project/builds/permissions.rb
+7
-0
features/steps/shared/builds.rb
features/steps/shared/builds.rb
+11
-2
features/steps/shared/project.rb
features/steps/shared/project.rb
+17
-1
No files found.
features/project/builds/artifacts.feature
View file @
6a504c82
...
...
@@ -2,8 +2,8 @@ Feature: Project Builds Artifacts
Background
:
Given
I sign in as a user
And
I own a project
And
CI is
enabled
And
I have recent build for my project
And
project has CI
enabled
And
project has a recent build
Scenario
:
I
download build artifacts
Given
recent build has artifacts available
...
...
This diff is collapsed.
Click to expand it.
features/project/builds/permissions.feature
0 → 100644
View file @
6a504c82
Feature
:
Project Builds Permissions
Background
:
Given
I sign in as a user
And
project exists in some group namespace
And
project has CI enabled
And
project has a recent build
Scenario
:
I
try to download build artifacts as guest
Given
I am member of a project with a guest role
And
recent build has artifacts available
When
I access artifacts download page
Then
page status code should be 404
Scenario
:
I
try to download build artifacts as reporter
Given
I am member of a project with a reporter role
And
recent build has artifacts available
When
I access artifacts download page
Then
download of build artifacts archive starts
This diff is collapsed.
Click to expand it.
features/project/builds/summary.feature
View file @
6a504c82
...
...
@@ -2,8 +2,8 @@ Feature: Project Builds Summary
Background
:
Given
I sign in as a user
And
I own a project
And
CI is
enabled
And
I have recent build for my project
And
project has CI
enabled
And
project has a recent build
Scenario
:
I
browse build summary page
When
I visit recent build summary page
...
...
This diff is collapsed.
Click to expand it.
features/steps/project/builds/artifacts.rb
View file @
6a504c82
...
...
@@ -8,11 +8,6 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
page
.
within
(
'.artifacts'
)
{
click_link
'Download'
}
end
step
'download of build artifacts archive starts'
do
expect
(
page
.
response_headers
[
'Content-Type'
]).
to
eq
'application/zip'
expect
(
page
.
response_headers
[
'Content-Transfer-Encoding'
]).
to
eq
'binary'
end
step
'I click artifacts browse button'
do
page
.
within
(
'.artifacts'
)
{
click_link
'Browse'
}
end
...
...
This diff is collapsed.
Click to expand it.
features/steps/project/builds/permissions.rb
0 → 100644
View file @
6a504c82
class
Spinach::Features::ProjectBuildsPermissions
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedBuilds
include
SharedPaths
include
RepoHelpers
end
This diff is collapsed.
Click to expand it.
features/steps/shared/builds.rb
View file @
6a504c82
module
SharedBuilds
include
Spinach
::
DSL
step
'
CI is
enabled'
do
step
'
project has CI
enabled'
do
@project
.
enable_ci
end
step
'
I have recent build for my project
'
do
step
'
project has a recent build
'
do
ci_commit
=
create
:ci_commit
,
project:
@project
,
sha:
sample_commit
.
id
@build
=
create
:ci_build
,
commit:
ci_commit
end
...
...
@@ -25,4 +25,13 @@ module SharedBuilds
gzip
=
fixture_file_upload
(
metadata
,
'application/x-gzip'
)
@build
.
update_attributes
(
artifacts_metadata:
gzip
)
end
step
'download of build artifacts archive starts'
do
expect
(
page
.
response_headers
[
'Content-Type'
]).
to
eq
'application/zip'
expect
(
page
.
response_headers
[
'Content-Transfer-Encoding'
]).
to
eq
'binary'
end
step
'I access artifacts download page'
do
visit
download_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
)
end
end
This diff is collapsed.
Click to expand it.
features/steps/shared/project.rb
View file @
6a504c82
...
...
@@ -7,6 +7,11 @@ module SharedProject
@project
.
team
<<
[
@user
,
:master
]
end
step
"project exists in some group namespace"
do
@group
=
create
(
:group
,
name:
'some group'
)
@project
=
create
(
:project
,
namespace:
@group
)
end
# Create a specific project called "Shop"
step
'I own project "Shop"'
do
@project
=
Project
.
find_by
(
name:
"Shop"
)
...
...
@@ -97,6 +102,18 @@ module SharedProject
@project
||=
Project
.
first
end
# ----------------------------------------
# Project permissions
# ----------------------------------------
step
'I am member of a project with a guest role'
do
@project
.
team
<<
[
@user
,
Gitlab
::
Access
::
GUEST
]
end
step
'I am member of a project with a reporter role'
do
@project
.
team
<<
[
@user
,
Gitlab
::
Access
::
REPORTER
]
end
# ----------------------------------------
# Visibility of archived project
# ----------------------------------------
...
...
@@ -229,5 +246,4 @@ module SharedProject
project
||=
create
(
:empty_project
,
visibility
,
name:
project_name
,
namespace:
user
.
namespace
)
project
.
team
<<
[
user
,
:master
]
end
end
This diff is collapsed.
Click to expand it.
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