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
0f8139f0
Commit
0f8139f0
authored
Mar 25, 2020
by
Vitali Tatarintev
Committed by
Stan Hu
Mar 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set to let_it_be in ee/spec
Get rids of `set` in specs
parent
8408c1bf
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
44 deletions
+41
-44
ee/spec/finders/merge_requests/by_approvals_finder_spec.rb
ee/spec/finders/merge_requests/by_approvals_finder_spec.rb
+5
-5
ee/spec/graphql/resolvers/design_management/designs_resolver_spec.rb
...phql/resolvers/design_management/designs_resolver_spec.rb
+5
-5
ee/spec/graphql/resolvers/design_management/version/designs_at_version_resolver_spec.rb
...gn_management/version/designs_at_version_resolver_spec.rb
+1
-1
ee/spec/lib/analytics/group_activity_calculator_spec.rb
ee/spec/lib/analytics/group_activity_calculator_spec.rb
+8
-8
ee/spec/models/design_management/design_spec.rb
ee/spec/models/design_management/design_spec.rb
+1
-1
ee/spec/models/geo/fdw/project_spec.rb
ee/spec/models/geo/fdw/project_spec.rb
+2
-2
ee/spec/models/geo/project_registry_spec.rb
ee/spec/models/geo/project_registry_spec.rb
+2
-2
ee/spec/requests/api/geo_nodes_spec.rb
ee/spec/requests/api/geo_nodes_spec.rb
+5
-7
ee/spec/requests/api/merge_requests_spec.rb
ee/spec/requests/api/merge_requests_spec.rb
+9
-10
ee/spec/services/metrics/dashboard/clone_dashboard_service_spec.rb
...ervices/metrics/dashboard/clone_dashboard_service_spec.rb
+3
-3
No files found.
ee/spec/finders/merge_requests/by_approvals_finder_spec.rb
View file @
0f8139f0
...
...
@@ -3,17 +3,17 @@
require
'spec_helper'
describe
MergeRequests
::
ByApprovalsFinder
do
set
(
:first_user
)
{
create
(
:user
)
}
set
(
:second_user
)
{
create
(
:user
)
}
let_it_be
(
:first_user
)
{
create
(
:user
)
}
let_it_be
(
:second_user
)
{
create
(
:user
)
}
let
(
:third_user
)
{
create
(
:user
)
}
set
(
:merge_request_without_approvals
)
{
create
(
:merge_request
)
}
set
(
:merge_request_with_first_user_approval
)
do
let_it_be
(
:merge_request_without_approvals
)
{
create
(
:merge_request
)
}
let_it_be
(
:merge_request_with_first_user_approval
)
do
create
(
:merge_request
).
tap
do
|
mr
|
create
(
:approval
,
merge_request:
mr
,
user:
first_user
)
end
end
set
(
:merge_request_with_both_approvals
)
do
let_it_be
(
:merge_request_with_both_approvals
)
do
create
(
:merge_request
).
tap
do
|
mr
|
create
(
:approval
,
merge_request:
mr
,
user:
first_user
)
create
(
:approval
,
merge_request:
mr
,
user:
second_user
)
...
...
ee/spec/graphql/resolvers/design_management/designs_resolver_spec.rb
View file @
0f8139f0
...
...
@@ -11,11 +11,11 @@ describe Resolvers::DesignManagement::DesignsResolver do
end
describe
'#resolve'
do
set
(
:issue
)
{
create
(
:issue
)
}
set
(
:project
)
{
issue
.
project
}
set
(
:first_version
)
{
create
(
:design_version
)
}
set
(
:first_design
)
{
create
(
:design
,
issue:
issue
,
versions:
[
first_version
])
}
set
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
)
}
let_it_be
(
:project
)
{
issue
.
project
}
let_it_be
(
:first_version
)
{
create
(
:design_version
)
}
let_it_be
(
:first_design
)
{
create
(
:design
,
issue:
issue
,
versions:
[
first_version
])
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let
(
:gql_context
)
{
{
current_user:
current_user
}
}
let
(
:args
)
{
{}
}
...
...
ee/spec/graphql/resolvers/design_management/version/designs_at_version_resolver_spec.rb
View file @
0f8139f0
...
...
@@ -7,7 +7,7 @@ describe Resolvers::DesignManagement::Version::DesignsAtVersionResolver do
include_context
'four designs in three versions'
set
(
:current_user
)
{
authorized_user
}
let_it_be
(
:current_user
)
{
authorized_user
}
let
(
:gql_context
)
{
{
current_user:
current_user
}
}
let
(
:version
)
{
third_version
}
...
...
ee/spec/lib/analytics/group_activity_calculator_spec.rb
View file @
0f8139f0
...
...
@@ -5,12 +5,12 @@ require 'spec_helper'
describe
Analytics
::
GroupActivityCalculator
do
subject
{
described_class
.
new
(
group
,
current_user
)
}
set
(
:group
)
{
create
(
:group
)
}
set
(
:current_user
)
{
create
(
:user
)
}
set
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
set
(
:project
)
{
create
(
:project
,
group:
subgroup
)
}
set
(
:secret_subgroup
)
{
create
(
:group
,
parent:
group
)
}
set
(
:secret_project
)
{
create
(
:project
,
group:
secret_subgroup
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
subgroup
)
}
let_it_be
(
:secret_subgroup
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:secret_project
)
{
create
(
:project
,
group:
secret_subgroup
)
}
before
do
subgroup
.
add_developer
(
current_user
)
...
...
@@ -18,8 +18,8 @@ describe Analytics::GroupActivityCalculator do
end
context
'with issues'
do
set
(
:recent_issue
)
{
create
(
:issue
,
project:
project
)
}
set
(
:old_issue
)
do
let_it_be
(
:recent_issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:old_issue
)
do
create
(
:issue
,
project:
project
,
created_at:
100
.
days
.
ago
)
...
...
ee/spec/models/design_management/design_spec.rb
View file @
0f8139f0
...
...
@@ -180,7 +180,7 @@ describe DesignManagement::Design do
end
describe
'#visible_in?'
do
set
(
:issue
)
{
create
(
:issue
)
}
let_it_be
(
:issue
)
{
create
(
:issue
)
}
# It is expensive to re-create complex histories, so we do it once, and then
# assert that we can establish visibility at any given version.
...
...
ee/spec/models/geo/fdw/project_spec.rb
View file @
0f8139f0
...
...
@@ -11,8 +11,8 @@ RSpec.describe Geo::Fdw::Project, :geo, type: :model do
end
describe
'.search'
do
set
(
:test_project
)
{
create
(
:project
,
description:
'kitten mittens'
)
}
set
(
:project
)
{
described_class
.
find
(
test_project
.
id
)
}
let_it_be
(
:test_project
,
refind:
true
)
{
create
(
:project
,
description:
'kitten mittens'
)
}
let_it_be
(
:project
)
{
described_class
.
find
(
test_project
.
id
)
}
it
'returns projects with a matching name'
do
expect
(
described_class
.
search
(
project
.
name
)).
to
eq
([
project
])
...
...
ee/spec/models/geo/project_registry_spec.rb
View file @
0f8139f0
...
...
@@ -6,8 +6,8 @@ describe Geo::ProjectRegistry do
include
::
EE
::
GeoHelpers
using
RSpec
::
Parameterized
::
TableSyntax
set
(
:project
)
{
create
(
:project
,
description:
'kitten mittens'
)
}
set
(
:registry
)
{
create
(
:geo_project_registry
,
project_id:
project
.
id
)
}
let_it_be
(
:project
,
refind:
true
)
{
create
(
:project
,
description:
'kitten mittens'
)
}
let_it_be
(
:registry
,
refind:
true
)
{
create
(
:geo_project_registry
,
project_id:
project
.
id
)
}
subject
{
registry
}
...
...
ee/spec/requests/api/geo_nodes_spec.rb
View file @
0f8139f0
...
...
@@ -8,16 +8,14 @@ describe API::GeoNodes, :request_store, :geo, :prometheus, api: true do
include_context
'custom session'
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
set
(
:secondary_status
)
{
create
(
:geo_node_status
,
:healthy
,
geo_node:
secondary
)
}
let_it_be
(
:admin
,
refind:
true
)
{
create
(
:admin
)
}
let_it_be
(
:user
,
refind:
true
)
{
create
(
:user
)
}
let_it_be
(
:primary
,
refind:
true
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
,
refind:
true
)
{
create
(
:geo_node
)
}
let_it_be
(
:secondary_status
,
refind:
true
)
{
create
(
:geo_node_status
,
:healthy
,
geo_node:
secondary
)
}
let
(
:unexisting_node_id
)
{
GeoNode
.
maximum
(
:id
).
to_i
.
succ
}
let
(
:group_to_sync
)
{
create
(
:group
)
}
set
(
:admin
)
{
create
(
:admin
)
}
set
(
:user
)
{
create
(
:user
)
}
describe
'POST /geo_nodes'
do
it
'denies access if not admin'
do
post
api
(
'/geo_nodes'
,
user
),
params:
{}
...
...
ee/spec/requests/api/merge_requests_spec.rb
View file @
0f8139f0
...
...
@@ -5,16 +5,15 @@ require "spec_helper"
describe
API
::
MergeRequests
do
include
ProjectForksHelper
set
(
:user
)
{
create
(
:user
)
}
set
(
:user2
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
set
(
:milestone
)
{
create
(
:milestone
,
title:
'1.0.0'
,
project:
project
)
}
set
(
:milestone1
)
{
create
(
:milestone
,
title:
'0.9'
,
project:
project
)
}
set
(
:label
)
{
create
(
:label
,
title:
'label'
,
color:
'#FFAABB'
,
project:
project
)
}
set
(
:label2
)
{
create
(
:label
,
title:
'a-test'
,
color:
'#FFFFFF'
,
project:
project
)
}
let
(
:base_time
)
{
Time
.
now
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
milestone:
milestone1
,
author:
user
,
assignees:
[
user
,
user2
],
source_project:
project
,
target_project:
project
,
title:
"Test"
,
created_at:
base_time
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
title:
'1.0.0'
,
project:
project
)
}
let_it_be
(
:milestone1
)
{
create
(
:milestone
,
title:
'0.9'
,
project:
project
)
}
let_it_be
(
:label
)
{
create
(
:label
,
title:
'label'
,
color:
'#FFAABB'
,
project:
project
)
}
let_it_be
(
:label2
)
{
create
(
:label
,
title:
'a-test'
,
color:
'#FFFFFF'
,
project:
project
)
}
let
(
:base_time
)
{
Time
.
now
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
milestone:
milestone1
,
author:
user
,
assignees:
[
user
,
user2
],
source_project:
project
,
target_project:
project
,
title:
"Test"
,
created_at:
base_time
)
}
before
do
project
.
add_reporter
(
user
)
...
...
ee/spec/services/metrics/dashboard/clone_dashboard_service_spec.rb
View file @
0f8139f0
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
Metrics
::
Dashboard
::
CloneDashboardService
,
:use_clean_rails_memory_store_caching
do
STAGES
=
::
Gitlab
::
Metrics
::
Dashboard
::
Stages
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
describe
'#execute'
do
subject
(
:service_call
)
{
described_class
.
new
(
project
,
user
,
params
).
execute
}
...
...
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