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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f012b32b
Commit
f012b32b
authored
Jun 25, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer `expect_next_instance_of` over `expect_any_instance_of`
parent
901159bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
spec/workers/delete_user_worker_spec.rb
spec/workers/delete_user_worker_spec.rb
+6
-4
No files found.
spec/workers/delete_user_worker_spec.rb
View file @
f012b32b
...
@@ -5,15 +5,17 @@ describe DeleteUserWorker do
...
@@ -5,15 +5,17 @@ describe DeleteUserWorker do
let!
(
:current_user
)
{
create
(
:user
)
}
let!
(
:current_user
)
{
create
(
:user
)
}
it
"calls the DeleteUserWorker with the params it was given"
do
it
"calls the DeleteUserWorker with the params it was given"
do
expect_any_instance_of
(
Users
::
DestroyService
).
to
receive
(
:execute
)
expect_next_instance_of
(
Users
::
DestroyService
)
do
|
service
|
.
with
(
user
,
{})
expect
(
service
).
to
receive
(
:execute
).
with
(
user
,
{})
end
described_class
.
new
.
perform
(
current_user
.
id
,
user
.
id
)
described_class
.
new
.
perform
(
current_user
.
id
,
user
.
id
)
end
end
it
"uses symbolized keys"
do
it
"uses symbolized keys"
do
expect_any_instance_of
(
Users
::
DestroyService
).
to
receive
(
:execute
)
expect_next_instance_of
(
Users
::
DestroyService
)
do
|
service
|
.
with
(
user
,
test:
"test"
)
expect
(
service
).
to
receive
(
:execute
).
with
(
user
,
test:
"test"
)
end
described_class
.
new
.
perform
(
current_user
.
id
,
user
.
id
,
"test"
=>
"test"
)
described_class
.
new
.
perform
(
current_user
.
id
,
user
.
id
,
"test"
=>
"test"
)
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