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
308e8f7e
Commit
308e8f7e
authored
Feb 18, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set with let_it_be in spec/graphql
Removes usage of `set` in specs
parent
11a40cc8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
33 deletions
+28
-33
spec/graphql/features/authorization_spec.rb
spec/graphql/features/authorization_spec.rb
+1
-2
spec/graphql/resolvers/concerns/resolves_pipelines_spec.rb
spec/graphql/resolvers/concerns/resolves_pipelines_spec.rb
+5
-5
spec/graphql/resolvers/group_resolver_spec.rb
spec/graphql/resolvers/group_resolver_spec.rb
+2
-2
spec/graphql/resolvers/issues_resolver_spec.rb
spec/graphql/resolvers/issues_resolver_spec.rb
+5
-5
spec/graphql/resolvers/merge_request_pipelines_resolver_spec.rb
...raphql/resolvers/merge_request_pipelines_resolver_spec.rb
+4
-4
spec/graphql/resolvers/merge_requests_resolver_spec.rb
spec/graphql/resolvers/merge_requests_resolver_spec.rb
+5
-8
spec/graphql/resolvers/project_pipelines_resolver_spec.rb
spec/graphql/resolvers/project_pipelines_resolver_spec.rb
+3
-3
spec/graphql/resolvers/project_resolver_spec.rb
spec/graphql/resolvers/project_resolver_spec.rb
+3
-4
No files found.
spec/graphql/features/authorization_spec.rb
View file @
308e8f7e
...
@@ -5,8 +5,7 @@ require 'spec_helper'
...
@@ -5,8 +5,7 @@ require 'spec_helper'
describe
'Gitlab::Graphql::Authorization'
do
describe
'Gitlab::Graphql::Authorization'
do
include
GraphqlHelpers
include
GraphqlHelpers
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:permission_single
)
{
:foo
}
let
(
:permission_single
)
{
:foo
}
let
(
:permission_collection
)
{
[
:foo
,
:bar
]
}
let
(
:permission_collection
)
{
[
:foo
,
:bar
]
}
let
(
:test_object
)
{
double
(
name:
'My name'
)
}
let
(
:test_object
)
{
double
(
name:
'My name'
)
}
...
...
spec/graphql/resolvers/concerns/resolves_pipelines_spec.rb
View file @
308e8f7e
...
@@ -17,11 +17,11 @@ describe ResolvesPipelines do
...
@@ -17,11 +17,11 @@ describe ResolvesPipelines do
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:private
)
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
set
(
:failed_pipeline
)
{
create
(
:ci_pipeline
,
:failed
,
project:
project
)
}
let_it_be
(
:failed_pipeline
)
{
create
(
:ci_pipeline
,
:failed
,
project:
project
)
}
set
(
:ref_pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'awesome-feature'
)
}
let_it_be
(
:ref_pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'awesome-feature'
)
}
set
(
:sha_pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
sha:
'deadbeef'
)
}
let_it_be
(
:sha_pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
sha:
'deadbeef'
)
}
before
do
before
do
project
.
add_developer
(
current_user
)
project
.
add_developer
(
current_user
)
...
...
spec/graphql/resolvers/group_resolver_spec.rb
View file @
308e8f7e
...
@@ -5,8 +5,8 @@ require 'spec_helper'
...
@@ -5,8 +5,8 @@ require 'spec_helper'
describe
Resolvers
::
GroupResolver
do
describe
Resolvers
::
GroupResolver
do
include
GraphqlHelpers
include
GraphqlHelpers
set
(
:group1
)
{
create
(
:group
)
}
let_it_be
(
:group1
)
{
create
(
:group
)
}
set
(
:group2
)
{
create
(
:group
)
}
let_it_be
(
:group2
)
{
create
(
:group
)
}
describe
'#resolve'
do
describe
'#resolve'
do
it
'batch-resolves groups by full path'
do
it
'batch-resolves groups by full path'
do
...
...
spec/graphql/resolvers/issues_resolver_spec.rb
View file @
308e8f7e
...
@@ -8,11 +8,11 @@ describe Resolvers::IssuesResolver do
...
@@ -8,11 +8,11 @@ describe Resolvers::IssuesResolver do
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
context
"with a project"
do
context
"with a project"
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
set
(
:issue1
)
{
create
(
:issue
,
project:
project
,
state: :opened
,
created_at:
3
.
hours
.
ago
,
updated_at:
3
.
hours
.
ago
)
}
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
state: :opened
,
created_at:
3
.
hours
.
ago
,
updated_at:
3
.
hours
.
ago
)
}
set
(
:issue2
)
{
create
(
:issue
,
project:
project
,
state: :closed
,
title:
'foo'
,
created_at:
1
.
hour
.
ago
,
updated_at:
1
.
hour
.
ago
,
closed_at:
1
.
hour
.
ago
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
state: :closed
,
title:
'foo'
,
created_at:
1
.
hour
.
ago
,
updated_at:
1
.
hour
.
ago
,
closed_at:
1
.
hour
.
ago
)
}
set
(
:label1
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:label1
)
{
create
(
:label
,
project:
project
)
}
set
(
:label2
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:label2
)
{
create
(
:label
,
project:
project
)
}
before
do
before
do
project
.
add_developer
(
current_user
)
project
.
add_developer
(
current_user
)
...
...
spec/graphql/resolvers/merge_request_pipelines_resolver_spec.rb
View file @
308e8f7e
...
@@ -5,8 +5,8 @@ require 'spec_helper'
...
@@ -5,8 +5,8 @@ require 'spec_helper'
describe
Resolvers
::
MergeRequestPipelinesResolver
do
describe
Resolvers
::
MergeRequestPipelinesResolver
do
include
GraphqlHelpers
include
GraphqlHelpers
set
(
:merge_request
)
{
create
(
:merge_request
)
}
let_it_be
(
:merge_request
)
{
create
(
:merge_request
)
}
set
(
:pipeline
)
do
let_it_be
(
:pipeline
)
do
create
(
create
(
:ci_pipeline
,
:ci_pipeline
,
project:
merge_request
.
source_project
,
project:
merge_request
.
source_project
,
...
@@ -14,8 +14,8 @@ describe Resolvers::MergeRequestPipelinesResolver do
...
@@ -14,8 +14,8 @@ describe Resolvers::MergeRequestPipelinesResolver do
sha:
merge_request
.
diff_head_sha
sha:
merge_request
.
diff_head_sha
)
)
end
end
set
(
:other_project_pipeline
)
{
create
(
:ci_pipeline
,
project:
merge_request
.
source_project
)
}
let_it_be
(
:other_project_pipeline
)
{
create
(
:ci_pipeline
,
project:
merge_request
.
source_project
)
}
set
(
:other_pipeline
)
{
create
(
:ci_pipeline
)
}
let_it_be
(
:other_pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
before
do
before
do
...
...
spec/graphql/resolvers/merge_requests_resolver_spec.rb
View file @
308e8f7e
...
@@ -5,16 +5,13 @@ require 'spec_helper'
...
@@ -5,16 +5,13 @@ require 'spec_helper'
describe
Resolvers
::
MergeRequestsResolver
do
describe
Resolvers
::
MergeRequestsResolver
do
include
GraphqlHelpers
include
GraphqlHelpers
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:merge_request_1
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
,
target_project:
project
)
}
let_it_be
(
:merge_request_1
)
{
create
(
:merge_request
,
:simple
,
source_project:
project
,
target_project:
project
)
}
set
(
:merge_request_2
)
{
create
(
:merge_request
,
:rebased
,
source_project:
project
,
target_project:
project
)
}
let_it_be
(
:merge_request_2
)
{
create
(
:merge_request
,
:rebased
,
source_project:
project
,
target_project:
project
)
}
let_it_be
(
:other_project
)
{
create
(
:project
,
:repository
)
}
set
(
:other_project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:other_merge_request
)
{
create
(
:merge_request
,
source_project:
other_project
,
target_project:
other_project
)
}
set
(
:other_merge_request
)
{
create
(
:merge_request
,
source_project:
other_project
,
target_project:
other_project
)
}
let
(
:iid_1
)
{
merge_request_1
.
iid
}
let
(
:iid_1
)
{
merge_request_1
.
iid
}
let
(
:iid_2
)
{
merge_request_2
.
iid
}
let
(
:iid_2
)
{
merge_request_2
.
iid
}
let
(
:other_iid
)
{
other_merge_request
.
iid
}
let
(
:other_iid
)
{
other_merge_request
.
iid
}
describe
'#resolve'
do
describe
'#resolve'
do
...
...
spec/graphql/resolvers/project_pipelines_resolver_spec.rb
View file @
308e8f7e
...
@@ -5,9 +5,9 @@ require 'spec_helper'
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
Resolvers
::
ProjectPipelinesResolver
do
describe
Resolvers
::
ProjectPipelinesResolver
do
include
GraphqlHelpers
include
GraphqlHelpers
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
set
(
:other_pipeline
)
{
create
(
:ci_pipeline
)
}
let_it_be
(
:other_pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
before
do
before
do
...
...
spec/graphql/resolvers/project_resolver_spec.rb
View file @
308e8f7e
...
@@ -5,10 +5,9 @@ require 'spec_helper'
...
@@ -5,10 +5,9 @@ require 'spec_helper'
describe
Resolvers
::
ProjectResolver
do
describe
Resolvers
::
ProjectResolver
do
include
GraphqlHelpers
include
GraphqlHelpers
set
(
:project1
)
{
create
(
:project
)
}
let_it_be
(
:project1
)
{
create
(
:project
)
}
set
(
:project2
)
{
create
(
:project
)
}
let_it_be
(
:project2
)
{
create
(
:project
)
}
let_it_be
(
:other_project
)
{
create
(
:project
)
}
set
(
:other_project
)
{
create
(
:project
)
}
describe
'#resolve'
do
describe
'#resolve'
do
it
'batch-resolves projects by full path'
do
it
'batch-resolves projects by full path'
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