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
e43bf390
Commit
e43bf390
authored
Nov 29, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing spec coverage
parent
d659cb6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
spec/initializers/forbid_sidekiq_in_transactions_spec.rb
spec/initializers/forbid_sidekiq_in_transactions_spec.rb
+32
-0
No files found.
spec/initializers/forbid_sidekiq_in_transactions_spec.rb
0 → 100644
View file @
e43bf390
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Sidekiq::Worker'
do
let
(
:worker_class
)
do
Class
.
new
do
include
Sidekiq
::
Worker
def
perform
end
end
end
it
'allows sidekiq worker outside of a transaction'
do
expect
{
worker_class
.
perform_async
}.
not_to
raise_error
end
it
'forbids queue sidekiq worker in a transaction'
do
Project
.
transaction
do
expect
{
worker_class
.
perform_async
}.
to
raise_error
(
Sidekiq
::
Worker
::
EnqueueFromTransactionError
)
end
end
it
'allows sidekiq worker in a transaction if skipped'
do
Sidekiq
::
Worker
.
skipping_transaction_check
do
Project
.
transaction
do
expect
{
worker_class
.
perform_async
}.
not_to
raise_error
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