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
6a504c82
Commit
6a504c82
authored
Jan 15, 2016
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
...
@@ -2,8 +2,8 @@ Feature: Project Builds Artifacts
Background
:
Background
:
Given
I sign in as a user
Given
I sign in as a user
And
I own a project
And
I own a project
And
CI is
enabled
And
project has CI
enabled
And
I have recent build for my project
And
project has a recent build
Scenario
:
I
download build artifacts
Scenario
:
I
download build artifacts
Given
recent build has artifacts available
Given
recent build has artifacts available
...
...
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
features/project/builds/summary.feature
View file @
6a504c82
...
@@ -2,8 +2,8 @@ Feature: Project Builds Summary
...
@@ -2,8 +2,8 @@ Feature: Project Builds Summary
Background
:
Background
:
Given
I sign in as a user
Given
I sign in as a user
And
I own a project
And
I own a project
And
CI is
enabled
And
project has CI
enabled
And
I have recent build for my project
And
project has a recent build
Scenario
:
I
browse build summary page
Scenario
:
I
browse build summary page
When
I visit recent build summary page
When
I visit recent build summary page
...
...
features/steps/project/builds/artifacts.rb
View file @
6a504c82
...
@@ -8,11 +8,6 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
...
@@ -8,11 +8,6 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
page
.
within
(
'.artifacts'
)
{
click_link
'Download'
}
page
.
within
(
'.artifacts'
)
{
click_link
'Download'
}
end
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
step
'I click artifacts browse button'
do
page
.
within
(
'.artifacts'
)
{
click_link
'Browse'
}
page
.
within
(
'.artifacts'
)
{
click_link
'Browse'
}
end
end
...
...
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
features/steps/shared/builds.rb
View file @
6a504c82
module
SharedBuilds
module
SharedBuilds
include
Spinach
::
DSL
include
Spinach
::
DSL
step
'
CI is
enabled'
do
step
'
project has CI
enabled'
do
@project
.
enable_ci
@project
.
enable_ci
end
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
ci_commit
=
create
:ci_commit
,
project:
@project
,
sha:
sample_commit
.
id
@build
=
create
:ci_build
,
commit:
ci_commit
@build
=
create
:ci_build
,
commit:
ci_commit
end
end
...
@@ -25,4 +25,13 @@ module SharedBuilds
...
@@ -25,4 +25,13 @@ module SharedBuilds
gzip
=
fixture_file_upload
(
metadata
,
'application/x-gzip'
)
gzip
=
fixture_file_upload
(
metadata
,
'application/x-gzip'
)
@build
.
update_attributes
(
artifacts_metadata:
gzip
)
@build
.
update_attributes
(
artifacts_metadata:
gzip
)
end
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
end
features/steps/shared/project.rb
View file @
6a504c82
...
@@ -7,6 +7,11 @@ module SharedProject
...
@@ -7,6 +7,11 @@ module SharedProject
@project
.
team
<<
[
@user
,
:master
]
@project
.
team
<<
[
@user
,
:master
]
end
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"
# Create a specific project called "Shop"
step
'I own project "Shop"'
do
step
'I own project "Shop"'
do
@project
=
Project
.
find_by
(
name:
"Shop"
)
@project
=
Project
.
find_by
(
name:
"Shop"
)
...
@@ -97,6 +102,18 @@ module SharedProject
...
@@ -97,6 +102,18 @@ module SharedProject
@project
||=
Project
.
first
@project
||=
Project
.
first
end
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
# Visibility of archived project
# ----------------------------------------
# ----------------------------------------
...
@@ -229,5 +246,4 @@ module SharedProject
...
@@ -229,5 +246,4 @@ module SharedProject
project
||=
create
(
:empty_project
,
visibility
,
name:
project_name
,
namespace:
user
.
namespace
)
project
||=
create
(
:empty_project
,
visibility
,
name:
project_name
,
namespace:
user
.
namespace
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
end
end
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