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
3f16c59c
Commit
3f16c59c
authored
Jan 24, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace owner with first_owner in mailer/model specs
parent
2f33a8cb
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
33 additions
and
25 deletions
+33
-25
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+1
-1
spec/models/ability_spec.rb
spec/models/ability_spec.rb
+1
-1
spec/models/ci/build_trace_chunk_spec.rb
spec/models/ci/build_trace_chunk_spec.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+2
-2
spec/models/ci/trigger_spec.rb
spec/models/ci/trigger_spec.rb
+1
-1
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+1
-1
spec/models/environment_status_spec.rb
spec/models/environment_status_spec.rb
+1
-1
spec/models/event_spec.rb
spec/models/event_spec.rb
+10
-10
spec/models/group_spec.rb
spec/models/group_spec.rb
+1
-1
spec/models/issue_collection_spec.rb
spec/models/issue_collection_spec.rb
+3
-1
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+2
-0
spec/models/note_spec.rb
spec/models/note_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+3
-1
spec/models/project_team_spec.rb
spec/models/project_team_spec.rb
+5
-3
No files found.
spec/mailers/notify_spec.rb
View file @
3f16c59c
...
...
@@ -714,7 +714,7 @@ RSpec.describe Notify do
describe
'project access requested'
do
let
(
:project
)
do
create
(
:project
,
:public
)
do
|
project
|
project
.
add_maintainer
(
project
.
owner
)
project
.
add_maintainer
(
project
.
first_
owner
)
end
end
...
...
spec/models/ability_spec.rb
View file @
3f16c59c
...
...
@@ -394,7 +394,7 @@ RSpec.describe Ability do
describe
'.project_disabled_features_rules'
do
let
(
:project
)
{
create
(
:project
,
:wiki_disabled
)
}
subject
{
described_class
.
policy_for
(
project
.
owner
,
project
)
}
subject
{
described_class
.
policy_for
(
project
.
first_
owner
,
project
)
}
context
'wiki named abilities'
do
it
'disables wiki abilities if the project has no wiki'
do
...
...
spec/models/ci/build_trace_chunk_spec.rb
View file @
3f16c59c
...
...
@@ -851,7 +851,7 @@ RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state, :clean_git
context
'when project is destroyed'
do
let
(
:subject
)
do
Projects
::
DestroyService
.
new
(
project
,
project
.
owner
).
execute
Projects
::
DestroyService
.
new
(
project
,
project
.
first_
owner
).
execute
end
it_behaves_like
'deletes all build_trace_chunk and data in redis'
...
...
spec/models/ci/pipeline_spec.rb
View file @
3f16c59c
...
...
@@ -3384,7 +3384,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
(
'master'
).
sha
,
user:
project
.
owner
)
user:
project
.
first_
owner
)
end
before
do
...
...
@@ -4459,7 +4459,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
describe
'#reset_source_bridge!'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:created
,
project:
project
)
}
subject
(
:reset_bridge
)
{
pipeline
.
reset_source_bridge!
(
project
.
owner
)
}
subject
(
:reset_bridge
)
{
pipeline
.
reset_source_bridge!
(
project
.
first_
owner
)
}
context
'when the pipeline is a child pipeline and the bridge is depended'
do
let!
(
:parent_pipeline
)
{
create
(
:ci_pipeline
)
}
...
...
spec/models/ci/trigger_spec.rb
View file @
3f16c59c
...
...
@@ -59,7 +59,7 @@ RSpec.describe Ci::Trigger do
end
it_behaves_like
'includes Limitable concern'
do
subject
{
build
(
:ci_trigger
,
owner:
project
.
owner
,
project:
project
)
}
subject
{
build
(
:ci_trigger
,
owner:
project
.
first_
owner
,
project:
project
)
}
end
context
'loose foreign key on ci_triggers.owner_id'
do
...
...
spec/models/commit_spec.rb
View file @
3f16c59c
...
...
@@ -486,7 +486,7 @@ eos
it
'uses the CachedMarkdownField cache instead of the Mentionable cache'
,
:use_clean_rails_redis_caching
do
expect
(
commit
.
title_html
).
not_to
be_present
commit
.
all_references
(
project
.
owner
).
all
commit
.
all_references
(
project
.
first_
owner
).
all
expect
(
commit
.
title_html
).
to
be_present
expect
(
Rails
.
cache
.
read
(
"banzai/commit:
#{
commit
.
id
}
/safe_message/single_line"
)).
to
be_nil
...
...
spec/models/environment_status_spec.rb
View file @
3f16c59c
...
...
@@ -161,7 +161,7 @@ RSpec.describe EnvironmentStatus do
let!
(
:build
)
{
create
(
:ci_build
,
:with_deployment
,
:deploy_to_production
,
pipeline:
pipeline
)
}
let
(
:environment
)
{
build
.
deployment
.
environment
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
context
'when environment is created on a forked project'
,
:sidekiq_inline
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
...
...
spec/models/event_spec.rb
View file @
3f16c59c
...
...
@@ -25,7 +25,7 @@ RSpec.describe Event do
expect
(
instance
).
to
receive
(
:reset_project_activity
)
end
create_push_event
(
project
,
project
.
owner
)
create_push_event
(
project
,
project
.
first_
owner
)
end
end
...
...
@@ -34,7 +34,7 @@ RSpec.describe Event do
it
'updates the project last_repository_updated_at and updated_at'
do
project
.
touch
(
:last_repository_updated_at
,
time:
1
.
year
.
ago
)
# rubocop: disable Rails/SkipsModelValidations
event
=
create_push_event
(
project
,
project
.
owner
)
event
=
create_push_event
(
project
,
project
.
first_
owner
)
project
.
reload
...
...
@@ -47,7 +47,7 @@ RSpec.describe Event do
it
'does not update the project last_repository_updated_at'
do
project
.
update!
(
last_repository_updated_at:
1
.
year
.
ago
)
create
(
:closed_issue_event
,
project:
project
,
author:
project
.
owner
)
create
(
:closed_issue_event
,
project:
project
,
author:
project
.
first_
owner
)
project
.
reload
...
...
@@ -63,14 +63,14 @@ RSpec.describe Event do
project
.
reload
# a reload removes fractions of seconds
expect
do
create_push_event
(
project
,
project
.
owner
)
create_push_event
(
project
,
project
.
first_
owner
)
project
.
reload
end
.
not_to
change
{
project
.
last_repository_updated_at
}
end
end
describe
'after_create UserInteractedProject.track'
do
let
(
:event
)
{
build
(
:push_event
,
project:
project
,
author:
project
.
owner
)
}
let
(
:event
)
{
build
(
:push_event
,
project:
project
,
author:
project
.
first_
owner
)
}
it
'passes event to UserInteractedProject.track'
do
expect
(
UserInteractedProject
).
to
receive
(
:track
).
with
(
event
)
...
...
@@ -157,7 +157,7 @@ RSpec.describe Event do
describe
"Push event"
do
let
(
:project
)
{
create
(
:project
,
:private
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:event
)
{
create_push_event
(
project
,
user
)
}
it
do
...
...
@@ -173,7 +173,7 @@ RSpec.describe Event do
describe
'#target_title'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:author
)
{
project
.
owner
}
let
(
:author
)
{
project
.
first_
owner
}
let
(
:target
)
{
nil
}
let
(
:event
)
do
...
...
@@ -746,7 +746,7 @@ RSpec.describe Event do
target
=
kind
==
:project
?
nil
:
build
(
kind
,
**
extra_data
)
[
kind
,
build
(
:event
,
:created
,
author:
project
.
owner
,
project:
project
,
target:
target
)]
[
kind
,
build
(
:event
,
:created
,
author:
project
.
first_
owner
,
project:
project
,
target:
target
)]
end
end
...
...
@@ -830,7 +830,7 @@ RSpec.describe Event do
expect
(
project
).
not_to
receive
(
:update_column
)
.
with
(
:last_activity_at
,
a_kind_of
(
Time
))
create_push_event
(
project
,
project
.
owner
)
create_push_event
(
project
,
project
.
first_
owner
)
end
end
...
...
@@ -838,7 +838,7 @@ RSpec.describe Event do
it
'updates the project'
do
project
.
touch
(
:last_activity_at
,
time:
1
.
year
.
ago
)
# rubocop: disable Rails/SkipsModelValidations
event
=
create_push_event
(
project
,
project
.
owner
)
event
=
create_push_event
(
project
,
project
.
first_
owner
)
project
.
reload
...
...
spec/models/group_spec.rb
View file @
3f16c59c
...
...
@@ -1249,7 +1249,7 @@ RSpec.describe Group do
let
(
:common_id
)
{
[
Project
.
maximum
(
:id
).
to_i
,
Namespace
.
maximum
(
:id
).
to_i
].
max
+
999
}
let!
(
:group
)
{
create
(
:group
,
id:
common_id
)
}
let!
(
:unrelated_project
)
{
create
(
:project
,
id:
common_id
)
}
let
(
:user
)
{
unrelated_project
.
owner
}
let
(
:user
)
{
unrelated_project
.
first_
owner
}
it
'returns correct access level'
do
expect
(
shared_group_parent
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
...
...
spec/models/issue_collection_spec.rb
View file @
3f16c59c
...
...
@@ -50,7 +50,9 @@ RSpec.describe IssueCollection do
end
end
context
'using a user that is the owner of a project'
do
# TODO update when we have multiple owners of a project
# https://gitlab.com/gitlab-org/gitlab/-/issues/350605
context
'using a user that is an owner of a project'
do
it
'returns the issues of the project'
do
expect
(
collection
.
updatable_by_user
(
project
.
namespace
.
owner
))
.
to
eq
([
issue1
,
issue2
])
...
...
spec/models/issue_spec.rb
View file @
3f16c59c
...
...
@@ -887,6 +887,8 @@ RSpec.describe Issue do
end
end
# TODO update when we have multiple owners of a project
# https://gitlab.com/gitlab-org/gitlab/-/issues/350605
context
'with an owner'
do
before
do
project
.
add_maintainer
(
user
)
...
...
spec/models/note_spec.rb
View file @
3f16c59c
...
...
@@ -617,7 +617,7 @@ RSpec.describe Note do
let
(
:note
)
do
create
:note
,
noteable:
ext_issue
,
project:
ext_proj
,
note:
"mentioned in
#{
ext_proj
.
owner
.
to_reference
}
"
,
note:
"mentioned in
#{
ext_proj
.
first_
owner
.
to_reference
}
"
,
system:
true
end
...
...
spec/models/project_spec.rb
View file @
3f16c59c
...
...
@@ -871,6 +871,8 @@ RSpec.describe Project, factory_default: :keep do
end
describe
'reference methods'
do
# TODO update when we have multiple owners of a project
# https://gitlab.com/gitlab-org/gitlab/-/issues/350605
let_it_be
(
:owner
)
{
create
(
:user
,
name:
'Gitlab'
)
}
let_it_be
(
:namespace
)
{
create
(
:namespace
,
name:
'Sample namespace'
,
path:
'sample-namespace'
,
owner:
owner
)
}
let_it_be
(
:project
)
{
create
(
:project
,
name:
'Sample project'
,
path:
'sample-project'
,
namespace:
namespace
)
}
...
...
@@ -2874,7 +2876,7 @@ RSpec.describe Project, factory_default: :keep do
end
before
do
project
.
repository
.
rm_branch
(
project
.
owner
,
branch
.
name
)
project
.
repository
.
rm_branch
(
project
.
first_
owner
,
branch
.
name
)
end
subject
{
project
.
latest_pipeline
(
branch
.
name
)
}
...
...
spec/models/project_team_spec.rb
View file @
3f16c59c
...
...
@@ -80,7 +80,7 @@ RSpec.describe ProjectTeam do
describe
'owner methods'
do
context
'personal project'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:owner
)
{
project
.
owner
}
let
(
:owner
)
{
project
.
first_
owner
}
specify
{
expect
(
project
.
team
.
owners
).
to
contain_exactly
(
owner
)
}
specify
{
expect
(
project
.
team
.
owner?
(
owner
)).
to
be_truthy
}
...
...
@@ -108,10 +108,12 @@ RSpec.describe ProjectTeam do
let
(
:project
)
{
create
(
:project
)
}
it
'returns project members'
do
# TODO this can be updated when we have multiple project owners
# See https://gitlab.com/gitlab-org/gitlab/-/issues/350605
user
=
create
(
:user
)
project
.
add_guest
(
user
)
expect
(
project
.
team
.
members
).
to
contain_exactly
(
user
,
project
.
owner
)
expect
(
project
.
team
.
members
).
to
contain_exactly
(
user
,
project
.
first_
owner
)
end
it
'returns project members of a specified level'
do
...
...
@@ -129,7 +131,7 @@ RSpec.describe ProjectTeam do
group_access:
Gitlab
::
Access
::
GUEST
)
expect
(
project
.
team
.
members
)
.
to
contain_exactly
(
group_member
.
user
,
project
.
owner
)
.
to
contain_exactly
(
group_member
.
user
,
project
.
first_
owner
)
end
it
'returns invited members of a group of a specified level'
do
...
...
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