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
feec8840
Commit
feec8840
authored
Feb 13, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set to let_it_be in spec/finders
Get rids of `set` in specs
parent
6625816c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
38 deletions
+38
-38
spec/finders/award_emojis_finder_spec.rb
spec/finders/award_emojis_finder_spec.rb
+6
-6
spec/finders/clusters_finder_spec.rb
spec/finders/clusters_finder_spec.rb
+1
-1
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+8
-8
spec/finders/jobs_finder_spec.rb
spec/finders/jobs_finder_spec.rb
+7
-7
spec/finders/members_finder_spec.rb
spec/finders/members_finder_spec.rb
+11
-11
spec/finders/merge_requests_finder_spec.rb
spec/finders/merge_requests_finder_spec.rb
+2
-2
spec/finders/resource_label_event_finder_spec.rb
spec/finders/resource_label_event_finder_spec.rb
+3
-3
No files found.
spec/finders/award_emojis_finder_spec.rb
View file @
feec8840
...
...
@@ -3,14 +3,14 @@
require
'spec_helper'
describe
AwardEmojisFinder
do
set
(
:issue_1
)
{
create
(
:issue
)
}
set
(
:issue_1_thumbsup
)
{
create
(
:award_emoji
,
name:
'thumbsup'
,
awardable:
issue_1
)
}
set
(
:issue_1_thumbsdown
)
{
create
(
:award_emoji
,
name:
'thumbsdown'
,
awardable:
issue_1
)
}
let_it_be
(
:issue_1
)
{
create
(
:issue
)
}
let_it_be
(
:issue_1_thumbsup
)
{
create
(
:award_emoji
,
name:
'thumbsup'
,
awardable:
issue_1
)
}
let_it_be
(
:issue_1_thumbsdown
)
{
create
(
:award_emoji
,
name:
'thumbsdown'
,
awardable:
issue_1
)
}
# Create a matching set of emoji for a second issue.
# These should never appear in our finder results
set
(
:issue_2
)
{
create
(
:issue
)
}
set
(
:issue_2_thumbsup
)
{
create
(
:award_emoji
,
name:
'thumbsup'
,
awardable:
issue_2
)
}
set
(
:issue_2_thumbsdown
)
{
create
(
:award_emoji
,
name:
'thumbsdown'
,
awardable:
issue_2
)
}
let_it_be
(
:issue_2
)
{
create
(
:issue
)
}
let_it_be
(
:issue_2_thumbsup
)
{
create
(
:award_emoji
,
name:
'thumbsup'
,
awardable:
issue_2
)
}
let_it_be
(
:issue_2_thumbsdown
)
{
create
(
:award_emoji
,
name:
'thumbsdown'
,
awardable:
issue_2
)
}
describe
'param validation'
do
it
'raises an error if `name` is invalid'
do
...
...
spec/finders/clusters_finder_spec.rb
View file @
feec8840
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
ClustersFinder
do
let
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
describe
'#execute'
do
let
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
...
...
spec/finders/issues_finder_spec.rb
View file @
feec8840
...
...
@@ -29,7 +29,7 @@ describe IssuesFinder do
end
context
'filter by username'
do
set
(
:user3
)
{
create
(
:user
)
}
let_it_be
(
:user3
)
{
create
(
:user
)
}
before
do
project2
.
add_developer
(
user3
)
...
...
@@ -53,7 +53,7 @@ describe IssuesFinder do
end
it_behaves_like
'no assignee filter'
do
set
(
:user3
)
{
create
(
:user
)
}
let_it_be
(
:user3
)
{
create
(
:user
)
}
let
(
:expected_issuables
)
{
[
issue4
]
}
end
...
...
@@ -679,7 +679,7 @@ describe IssuesFinder do
end
context
'filtering by confidential'
do
set
(
:confidential_issue
)
{
create
(
:issue
,
project:
project1
,
confidential:
true
)
}
let_it_be
(
:confidential_issue
)
{
create
(
:issue
,
project:
project1
,
confidential:
true
)
}
context
'no filtering'
do
it
'returns all issues'
do
...
...
@@ -777,7 +777,7 @@ describe IssuesFinder do
it
'returns the number of rows for the default state'
do
finder
=
described_class
.
new
(
user
)
expect
(
finder
.
row_count
).
to
eq
(
5
)
expect
(
finder
.
row_count
).
to
eq
(
4
)
end
it
'returns the number of rows for a given state'
do
...
...
@@ -790,10 +790,10 @@ describe IssuesFinder do
describe
'#with_confidentiality_access_check'
do
let
(
:guest
)
{
create
(
:user
)
}
set
(
:authorized_user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
authorized_user
.
namespace
)
}
set
(
:public_issue
)
{
create
(
:issue
,
project:
project
)
}
set
(
:confidential_issue
)
{
create
(
:issue
,
project:
project
,
confidential:
true
)
}
let_it_be
(
:authorized_user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
authorized_user
.
namespace
)
}
let_it_be
(
:public_issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:confidential_issue
)
{
create
(
:issue
,
project:
project
,
confidential:
true
)
}
context
'when no project filter is given'
do
let
(
:params
)
{
{}
}
...
...
spec/finders/jobs_finder_spec.rb
View file @
feec8840
...
...
@@ -3,13 +3,13 @@
require
'spec_helper'
describe
JobsFinder
,
'#execute'
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:user
,
:admin
)
}
set
(
:project
)
{
create
(
:project
,
:private
,
public_builds:
false
)
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
set
(
:job_1
)
{
create
(
:ci_build
)
}
set
(
:job_2
)
{
create
(
:ci_build
,
:running
)
}
set
(
:job_3
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:user
,
:admin
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:private
,
public_builds:
false
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:job_1
)
{
create
(
:ci_build
)
}
let_it_be
(
:job_2
)
{
create
(
:ci_build
,
:running
)
}
let_it_be
(
:job_3
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
}
let
(
:params
)
{
{}
}
...
...
spec/finders/members_finder_spec.rb
View file @
feec8840
...
...
@@ -3,13 +3,13 @@
require
'spec_helper'
describe
MembersFinder
,
'#execute'
do
set
(
:group
)
{
create
(
:group
)
}
set
(
:nested_group
)
{
create
(
:group
,
parent:
group
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
nested_group
)
}
set
(
:user1
)
{
create
(
:user
)
}
set
(
:user2
)
{
create
(
:user
)
}
set
(
:user3
)
{
create
(
:user
)
}
set
(
:user4
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:nested_group
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
namespace:
nested_group
)
}
let_it_be
(
:user1
)
{
create
(
:user
)
}
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:user3
)
{
create
(
:user
)
}
let_it_be
(
:user4
)
{
create
(
:user
)
}
it
'returns members for project and parent groups'
do
nested_group
.
request_access
(
user1
)
...
...
@@ -128,10 +128,10 @@ describe MembersFinder, '#execute' do
context
'when include_invited_groups_members == true'
do
subject
{
described_class
.
new
(
project
,
user2
).
execute
(
include_relations:
[
:inherited
,
:direct
,
:invited_groups_members
])
}
set
(
:linked_group
)
{
create
(
:group
,
:public
)
}
set
(
:nested_linked_group
)
{
create
(
:group
,
parent:
linked_group
)
}
set
(
:linked_group_member
)
{
linked_group
.
add_guest
(
user1
)
}
set
(
:nested_linked_group_member
)
{
nested_linked_group
.
add_guest
(
user2
)
}
let_it_be
(
:linked_group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:nested_linked_group
)
{
create
(
:group
,
parent:
linked_group
)
}
let_it_be
(
:linked_group_member
)
{
linked_group
.
add_guest
(
user1
)
}
let_it_be
(
:nested_linked_group_member
)
{
nested_linked_group
.
add_guest
(
user2
)
}
it
'includes all the invited_groups members including members inherited from ancestor groups'
do
create
(
:project_group_link
,
project:
project
,
group:
nested_linked_group
)
...
...
spec/finders/merge_requests_finder_spec.rb
View file @
feec8840
...
...
@@ -214,13 +214,13 @@ describe MergeRequestsFinder do
merge_request3
.
assignees
=
[
user2
,
user3
]
end
set
(
:user3
)
{
create
(
:user
)
}
let_it_be
(
:user3
)
{
create
(
:user
)
}
let
(
:params
)
{
{
assignee_username:
[
user2
.
username
,
user3
.
username
]
}
}
let
(
:expected_issuables
)
{
[
merge_request3
]
}
end
it_behaves_like
'no assignee filter'
do
set
(
:user3
)
{
create
(
:user
)
}
let_it_be
(
:user3
)
{
create
(
:user
)
}
let
(
:expected_issuables
)
{
[
merge_request4
,
merge_request5
]
}
end
...
...
spec/finders/resource_label_event_finder_spec.rb
View file @
feec8840
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
ResourceLabelEventFinder
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:issue_project
)
{
create
(
:project
)
}
set
(
:issue
)
{
create
(
:issue
,
project:
issue_project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue_project
)
{
create
(
:project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
issue_project
)
}
describe
'#execute'
do
subject
{
described_class
.
new
(
user
,
issue
).
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