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
5a7ef6df
Commit
5a7ef6df
authored
Jan 24, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace owner with first_owner in policy specs
parent
2f33a8cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
spec/policies/ci/pipeline_policy_spec.rb
spec/policies/ci/pipeline_policy_spec.rb
+3
-3
spec/policies/namespaces/project_namespace_policy_spec.rb
spec/policies/namespaces/project_namespace_policy_spec.rb
+1
-1
spec/policies/project_member_policy_spec.rb
spec/policies/project_member_policy_spec.rb
+1
-1
spec/policies/project_policy_spec.rb
spec/policies/project_policy_spec.rb
+2
-2
No files found.
spec/policies/ci/pipeline_policy_spec.rb
View file @
5a7ef6df
...
...
@@ -89,7 +89,7 @@ RSpec.describe Ci::PipelinePolicy, :models do
let
(
:project
)
{
create
(
:project
,
:public
)
}
context
'when user has owner access'
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
it
'is enabled'
do
expect
(
policy
).
to
be_allowed
:destroy_pipeline
...
...
@@ -107,7 +107,7 @@ RSpec.describe Ci::PipelinePolicy, :models do
let
(
:project
)
{
create
(
:project
,
:public
)
}
context
'when user has owner access'
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
it
'is enabled'
do
expect
(
policy
).
to
be_allowed
:read_pipeline_variable
...
...
@@ -129,7 +129,7 @@ RSpec.describe Ci::PipelinePolicy, :models do
end
context
'when user is developer and it is not the creator of the pipeline'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
,
user:
project
.
owner
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
,
user:
project
.
first_
owner
)
}
before
do
project
.
add_developer
(
user
)
...
...
spec/policies/namespaces/project_namespace_policy_spec.rb
View file @
5a7ef6df
...
...
@@ -28,7 +28,7 @@ RSpec.describe Namespaces::ProjectNamespacePolicy do
end
context
'parent owner'
do
let_it_be
(
:current_user
)
{
parent
.
owner
}
let_it_be
(
:current_user
)
{
parent
.
first_
owner
}
it
{
is_expected
.
to
be_disallowed
(
*
permissions
)
}
end
...
...
spec/policies/project_member_policy_spec.rb
View file @
5a7ef6df
...
...
@@ -24,7 +24,7 @@ RSpec.describe ProjectMemberPolicy do
end
context
'when user is project owner'
do
let
(
:member_user
)
{
project
.
owner
}
let
(
:member_user
)
{
project
.
first_
owner
}
let
(
:member
)
{
project
.
members
.
find_by!
(
user:
member_user
)
}
it
{
is_expected
.
to
be_allowed
(
:read_project
)
}
...
...
spec/policies/project_policy_spec.rb
View file @
5a7ef6df
...
...
@@ -117,7 +117,7 @@ RSpec.describe ProjectPolicy do
end
describe
'for unconfirmed user'
do
let
(
:current_user
)
{
project
.
owner
.
tap
{
|
u
|
u
.
update!
(
confirmed_at:
nil
)
}
}
let
(
:current_user
)
{
project
.
first_
owner
.
tap
{
|
u
|
u
.
update!
(
confirmed_at:
nil
)
}
}
it
'disallows to modify pipelines'
do
expect_disallowed
(
:create_pipeline
)
...
...
@@ -144,7 +144,7 @@ RSpec.describe ProjectPolicy do
end
describe
'for project owner'
do
let
(
:current_user
)
{
project
.
owner
}
let
(
:current_user
)
{
project
.
first_
owner
}
it
'allows :destroy_pipeline'
do
expect
(
current_user
.
can?
(
:destroy_pipeline
,
pipeline
)).
to
be_truthy
...
...
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