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
3f25fd78
Commit
3f25fd78
authored
Mar 17, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use around block to set and restore the DatabaseCleaner strategy
parent
7fddfa0b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
spec/services/groups/destroy_service_spec.rb
spec/services/groups/destroy_service_spec.rb
+8
-6
No files found.
spec/services/groups/destroy_service_spec.rb
View file @
3f25fd78
...
...
@@ -61,8 +61,14 @@ describe Groups::DestroyService, services: true do
context
'potential race conditions'
do
context
"when the `GroupDestroyWorker` task runs immediately"
do
before
do
DatabaseCleaner
.
strategy
=
:deletion
around
(
:each
)
do
|
example
|
old_strategy
=
DatabaseCleaner
[
:active_record
,
{
connection:
ActiveRecord
::
Base
}].
strategy
DatabaseCleaner
[
:active_record
,
{
connection:
ActiveRecord
::
Base
}].
strategy
=
:deletion
begin
example
.
run
ensure
DatabaseCleaner
[
:active_record
,
{
connection:
ActiveRecord
::
Base
}].
strategy
=
old_strategy
end
end
it
"deletes the group"
do
...
...
@@ -98,10 +104,6 @@ describe Groups::DestroyService, services: true do
expect
(
group_record
).
to
be_nil
end
after
do
DatabaseCleaner
.
strategy
=
:transaction
end
end
end
end
...
...
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