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
04d9fb3f
Commit
04d9fb3f
authored
Feb 11, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set with let_it_be in spec/models
Get rids of set in favor of let_it_be
parent
5bb583bf
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
56 additions
and
56 deletions
+56
-56
spec/models/chat_name_spec.rb
spec/models/chat_name_spec.rb
+1
-1
spec/models/chat_team_spec.rb
spec/models/chat_team_spec.rb
+1
-1
spec/models/ci/bridge_spec.rb
spec/models/ci/bridge_spec.rb
+3
-3
spec/models/ci/build_metadata_spec.rb
spec/models/ci/build_metadata_spec.rb
+4
-4
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+9
-9
spec/models/ci/build_trace_chunk_spec.rb
spec/models/ci/build_trace_chunk_spec.rb
+2
-2
spec/models/ci/processable_spec.rb
spec/models/ci/processable_spec.rb
+2
-2
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+3
-3
spec/models/diff_viewer/server_side_spec.rb
spec/models/diff_viewer/server_side_spec.rb
+1
-1
spec/models/event_collection_spec.rb
spec/models/event_collection_spec.rb
+4
-4
spec/models/guest_spec.rb
spec/models/guest_spec.rb
+3
-3
spec/models/list_user_preference_spec.rb
spec/models/list_user_preference_spec.rb
+2
-2
spec/models/pages_domain_spec.rb
spec/models/pages_domain_spec.rb
+5
-5
spec/models/project_services/microsoft_teams_service_spec.rb
spec/models/project_services/microsoft_teams_service_spec.rb
+2
-2
spec/models/project_services/prometheus_service_spec.rb
spec/models/project_services/prometheus_service_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+12
-12
spec/models/releases/source_spec.rb
spec/models/releases/source_spec.rb
+1
-1
No files found.
spec/models/chat_name_spec.rb
View file @
04d9fb3f
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
ChatName
do
set
(
:chat_name
)
{
create
(
:chat_name
)
}
let_it_be
(
:chat_name
)
{
create
(
:chat_name
)
}
subject
{
chat_name
}
it
{
is_expected
.
to
belong_to
(
:service
)
}
...
...
spec/models/chat_team_spec.rb
View file @
04d9fb3f
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
ChatTeam
do
set
(
:chat_team
)
{
create
(
:chat_team
)
}
let_it_be
(
:chat_team
)
{
create
(
:chat_team
)
}
subject
{
chat_team
}
# Associations
...
...
spec/models/ci/bridge_spec.rb
View file @
04d9fb3f
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Ci
::
Bridge
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:target_project
)
{
create
(
:project
,
name:
'project'
,
namespace:
create
(
:namespace
,
name:
'my'
))
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:target_project
)
{
create
(
:project
,
name:
'project'
,
namespace:
create
(
:namespace
,
name:
'my'
))
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:bridge
)
do
create
(
:ci_bridge
,
:variables
,
status: :created
,
...
...
spec/models/ci/build_metadata_spec.rb
View file @
04d9fb3f
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
describe
Ci
::
BuildMetadata
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
group:
group
,
build_timeout:
2000
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
group:
group
,
build_timeout:
2000
)
}
set
(
:pipeline
)
do
let_it_be
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
project
.
default_branch
,
...
...
spec/models/ci/build_spec.rb
View file @
04d9fb3f
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
describe
Ci
::
Build
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
group:
group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
,
reload:
true
)
{
create
(
:group
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
,
group:
group
)
}
set
(
:pipelin
e
)
do
let_it_be
(
:pipeline
,
reload:
tru
e
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
project
.
default_branch
,
...
...
@@ -3611,7 +3611,7 @@ describe Ci::Build do
end
describe
'.matches_tag_ids'
do
set
(
:build
)
{
create
(
:ci_build
,
project:
project
,
user:
user
)
}
let_it_be
(
:build
,
reload:
true
)
{
create
(
:ci_build
,
project:
project
,
user:
user
)
}
let
(
:tag_ids
)
{
::
ActsAsTaggableOn
::
Tag
.
named_any
(
tag_list
).
ids
}
subject
{
described_class
.
where
(
id:
build
).
matches_tag_ids
(
tag_ids
)
}
...
...
@@ -3658,7 +3658,7 @@ describe Ci::Build do
end
describe
'.matches_tags'
do
set
(
:build
)
{
create
(
:ci_build
,
project:
project
,
user:
user
)
}
let_it_be
(
:build
,
reload:
true
)
{
create
(
:ci_build
,
project:
project
,
user:
user
)
}
subject
{
described_class
.
where
(
id:
build
).
with_any_tags
}
...
...
@@ -3684,7 +3684,7 @@ describe Ci::Build do
end
describe
'pages deployments'
do
set
(
:build
)
{
create
(
:ci_build
,
project:
project
,
user:
user
)
}
let_it_be
(
:build
,
reload:
true
)
{
create
(
:ci_build
,
project:
project
,
user:
user
)
}
context
'when job is "pages"'
do
before
do
...
...
@@ -3851,7 +3851,7 @@ describe Ci::Build do
end
describe
'#artifacts_metadata_entry'
do
set
(
:build
)
{
create
(
:ci_build
,
project:
project
)
}
let_it_be
(
:build
)
{
create
(
:ci_build
,
project:
project
)
}
let
(
:path
)
{
'other_artifacts_0.1.2/another-subdirectory/banana_sample.gif'
}
around
do
|
example
|
...
...
@@ -3951,7 +3951,7 @@ describe Ci::Build do
end
describe
'#supported_runner?'
do
set
(
:build
)
{
create
(
:ci_build
)
}
let_it_be
(
:build
)
{
create
(
:ci_build
)
}
subject
{
build
.
supported_runner?
(
runner_features
)
}
...
...
spec/models/ci/build_trace_chunk_spec.rb
View file @
04d9fb3f
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Ci
::
BuildTraceChunk
,
:clean_gitlab_redis_shared_state
do
include
ExclusiveLeaseHelpers
set
(
:build
)
{
create
(
:ci_build
,
:running
)
}
let_it_be
(
:build
)
{
create
(
:ci_build
,
:running
)
}
let
(
:chunk_index
)
{
0
}
let
(
:data_store
)
{
:redis
}
let
(
:raw_data
)
{
nil
}
...
...
@@ -24,7 +24,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do
context
'FastDestroyAll'
do
let
(
:parent
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
parent
)
}
let
(
:build
)
{
create
(
:ci_build
,
:running
,
:trace_live
,
pipeline:
pipeline
,
project:
parent
)
}
let
!
(
:build
)
{
create
(
:ci_build
,
:running
,
:trace_live
,
pipeline:
pipeline
,
project:
parent
)
}
let
(
:subjects
)
{
build
.
trace_chunks
}
describe
'Forbid #destroy and #destroy_all'
do
...
...
spec/models/ci/processable_spec.rb
View file @
04d9fb3f
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Ci
::
Processable
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
describe
'#aggregated_needs_names'
do
let
(
:with_aggregated_needs
)
{
pipeline
.
processables
.
select_with_aggregated_needs
(
project
)
}
...
...
spec/models/ci/runner_spec.rb
View file @
04d9fb3f
...
...
@@ -38,8 +38,8 @@ describe Ci::Runner do
end
context
'runner_type validations'
do
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:group_runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
let
(
:project_runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
let
(
:instance_runner
)
{
create
(
:ci_runner
,
:instance
)
}
...
...
@@ -322,7 +322,7 @@ describe Ci::Runner do
end
describe
'#can_pick?'
do
set
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:runner_project
)
{
build
.
project
}
let
(
:runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
runner_project
],
tag_list:
tag_list
,
run_untagged:
run_untagged
)
}
...
...
spec/models/diff_viewer/server_side_spec.rb
View file @
04d9fb3f
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
DiffViewer
::
ServerSide
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:commit
)
{
project
.
commit_by
(
oid:
'570e7b2abdd848b95f2f578043fc23bd6f6fd24d'
)
}
let!
(
:diff_file
)
{
commit
.
diffs
.
diff_file_with_new_path
(
'files/ruby/popen.rb'
)
}
...
...
spec/models/event_collection_spec.rb
View file @
04d9fb3f
...
...
@@ -4,10 +4,10 @@ require 'spec_helper'
describe
EventCollection
do
describe
'#to_a'
do
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project_empty_repo
,
group:
group
)
}
set
(
:projects
)
{
Project
.
where
(
id:
project
.
id
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project_empty_repo
,
group:
group
)
}
let_it_be
(
:projects
)
{
Project
.
where
(
id:
project
.
id
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
context
'with project events'
do
before
do
...
...
spec/models/guest_spec.rb
View file @
04d9fb3f
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Guest
do
set
(
:public_project
)
{
create
(
:project
,
:public
)
}
set
(
:private_project
)
{
create
(
:project
,
:private
)
}
set
(
:internal_project
)
{
create
(
:project
,
:internal
)
}
let_it_be
(
:public_project
,
reload:
true
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:internal_project
)
{
create
(
:project
,
:internal
)
}
describe
'.can_pull?'
do
context
'when project is private'
do
...
...
spec/models/list_user_preference_spec.rb
View file @
04d9fb3f
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
ListUserPreference
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:list
)
{
create
(
:list
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:list
)
{
create
(
:list
)
}
before
do
list
.
update_preferences_for
(
user
,
{
collapsed:
true
})
...
...
spec/models/pages_domain_spec.rb
View file @
04d9fb3f
...
...
@@ -352,9 +352,9 @@ describe PagesDomain do
end
context
'configuration updates when attributes change'
do
set
(
:project1
)
{
create
(
:project
)
}
set
(
:project2
)
{
create
(
:project
)
}
set
(
:domain
)
{
create
(
:pages_domain
)
}
let_it_be
(
:project1
)
{
create
(
:project
)
}
let_it_be
(
:project2
)
{
create
(
:project
)
}
let_it_be
(
:domain
)
{
create
(
:pages_domain
)
}
where
(
:attribute
,
:old_value
,
:new_value
,
:update_expected
)
do
now
=
Time
.
now
...
...
@@ -402,8 +402,8 @@ describe PagesDomain do
end
context
'TLS configuration'
do
set
(
:domain_without_tls
)
{
create
(
:pages_domain
,
:without_certificate
,
:without_key
)
}
set
(
:domain
)
{
create
(
:pages_domain
)
}
let_it_be
(
:domain_without_tls
)
{
create
(
:pages_domain
,
:without_certificate
,
:without_key
)
}
let_it_be
(
:domain
)
{
create
(
:pages_domain
)
}
let
(
:cert1
)
{
domain
.
certificate
}
let
(
:cert2
)
{
cert1
+
' '
}
...
...
spec/models/project_services/microsoft_teams_service_spec.rb
View file @
04d9fb3f
...
...
@@ -37,9 +37,9 @@ describe MicrosoftTeamsService do
end
describe
"#execute"
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
before
do
allow
(
chat_service
).
to
receive_messages
(
...
...
spec/models/project_services/prometheus_service_spec.rb
View file @
04d9fb3f
...
...
@@ -169,7 +169,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do
end
context
'cluster belongs to projects group'
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:prometheus_project
,
group:
group
)
}
let
(
:cluster
)
{
create
(
:cluster_for_group
,
:with_installed_helm
,
groups:
[
group
])
}
...
...
spec/models/project_spec.rb
View file @
04d9fb3f
...
...
@@ -3901,7 +3901,7 @@ describe Project do
end
context
'legacy storage'
do
set
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
)
}
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:project_storage
)
{
project
.
send
(
:storage
)
}
...
...
@@ -4000,7 +4000,7 @@ describe Project do
end
context
'hashed storage'
do
set
(
:project
)
{
create
(
:project
,
:repository
,
skip_disk_validation:
true
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
skip_disk_validation:
true
)
}
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:hash
)
{
Digest
::
SHA2
.
hexdigest
(
project
.
id
.
to_s
)
}
let
(
:hashed_prefix
)
{
File
.
join
(
'@hashed'
,
hash
[
0
..
1
],
hash
[
2
..
3
])
}
...
...
@@ -4090,7 +4090,7 @@ describe Project do
end
describe
'#has_ci?'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let
(
:repository
)
{
double
}
before
do
...
...
@@ -4134,7 +4134,7 @@ describe Project do
Feature
.
get
(
:force_autodevops_on_by_default
).
enable_percentage_of_actors
(
0
)
end
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
subject
{
project
.
auto_devops_enabled?
}
...
...
@@ -4269,7 +4269,7 @@ describe Project do
end
describe
'#has_auto_devops_implicitly_enabled?'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
context
'when disabled in settings'
do
before
do
...
...
@@ -4330,7 +4330,7 @@ describe Project do
end
describe
'#has_auto_devops_implicitly_disabled?'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
before
do
allow
(
Feature
).
to
receive
(
:enabled?
).
and_call_original
...
...
@@ -4408,7 +4408,7 @@ describe Project do
end
describe
'#api_variables'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
it
'exposes API v4 URL'
do
expect
(
project
.
api_variables
.
first
[
:key
]).
to
eq
'CI_API_V4_URL'
...
...
@@ -4605,7 +4605,7 @@ describe Project do
end
describe
'#write_repository_config'
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'writes full path in .git/config when key is missing'
do
project
.
write_repository_config
...
...
@@ -4696,7 +4696,7 @@ describe Project do
end
describe
'#has_active_hooks?'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
it
{
expect
(
project
.
has_active_hooks?
).
to
be_falsey
}
...
...
@@ -4723,7 +4723,7 @@ describe Project do
end
describe
'#has_active_services?'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
it
{
expect
(
project
.
has_active_services?
).
to
be_falsey
}
...
...
@@ -5009,8 +5009,8 @@ describe Project do
describe
'#members_among'
do
let
(
:users
)
{
create_list
(
:user
,
3
)
}
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
before
do
project
.
add_guest
(
users
.
first
)
...
...
spec/models/releases/source_spec.rb
View file @
04d9fb3f
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Releases
::
Source
do
set
(
:project
)
{
create
(
:project
,
:repository
,
name:
'finance-cal'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
name:
'finance-cal'
)
}
let
(
:tag_name
)
{
'v1.0'
}
describe
'.all'
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