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
a32daf12
Commit
a32daf12
authored
Feb 22, 2021
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some unrelated rubocop offenses
Revealed via `REVEAL_RUBOCOP_TODO`.
parent
a76c0301
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
spec/lib/gitlab/database/bulk_update_spec.rb
spec/lib/gitlab/database/bulk_update_spec.rb
+9
-9
No files found.
spec/lib/gitlab/database/bulk_update_spec.rb
View file @
a32daf12
...
...
@@ -13,8 +13,8 @@ RSpec.describe Gitlab::Database::BulkUpdate do
i_a
,
i_b
=
create_list
(
:issue
,
2
)
{
i_a
=>
{
title:
'Issue a'
},
i_b
=>
{
title:
'Issue b'
}
i_a
=>
{
title:
'Issue a'
},
i_b
=>
{
title:
'Issue b'
}
}
end
...
...
@@ -51,7 +51,7 @@ RSpec.describe Gitlab::Database::BulkUpdate do
it
'is possible to update all objects in a single query'
do
users
=
create_list
(
:user
,
3
)
mapping
=
users
.
zip
(
%w
(foo bar baz)
).
to_h
do
|
u
,
name
|
mapping
=
users
.
zip
(
%w
[foo bar baz]
).
to_h
do
|
u
,
name
|
[
u
,
{
username:
name
,
admin:
true
}]
end
...
...
@@ -61,13 +61,13 @@ RSpec.describe Gitlab::Database::BulkUpdate do
# We have optimistically updated the values
expect
(
users
).
to
all
(
be_admin
)
expect
(
users
.
map
(
&
:username
)).
to
eq
(
%w
(foo bar baz)
)
expect
(
users
.
map
(
&
:username
)).
to
eq
(
%w
[foo bar baz]
)
users
.
each
(
&
:reset
)
# The values are correct on reset
expect
(
users
).
to
all
(
be_admin
)
expect
(
users
.
map
(
&
:username
)).
to
eq
(
%w
(foo bar baz)
)
expect
(
users
.
map
(
&
:username
)).
to
eq
(
%w
[foo bar baz]
)
end
it
'is possible to update heterogeneous sets'
do
...
...
@@ -79,8 +79,8 @@ RSpec.describe Gitlab::Database::BulkUpdate do
mapping
=
{
mr_a
=>
{
title:
'MR a'
},
i_a
=>
{
title:
'Issue a'
},
i_b
=>
{
title:
'Issue b'
}
i_a
=>
{
title:
'Issue a'
},
i_b
=>
{
title:
'Issue b'
}
}
expect
do
...
...
@@ -99,8 +99,8 @@ RSpec.describe Gitlab::Database::BulkUpdate do
i_a
,
i_b
=
create_list
(
:issue
,
2
)
mapping
=
{
i_a
=>
{
title:
'Issue a'
},
i_b
=>
{
title:
'Issue b'
}
i_a
=>
{
title:
'Issue a'
},
i_b
=>
{
title:
'Issue b'
}
}
described_class
.
execute
(
%i[title]
,
mapping
)
...
...
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