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
71b55808
Commit
71b55808
authored
Apr 07, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RSpec/VoidExpect offenses
parent
fcf2ee20
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
17 deletions
+9
-17
.rubocop_todo.yml
.rubocop_todo.yml
+0
-8
spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb
.../services/user_activates_mattermost_slash_command_spec.rb
+1
-1
spec/models/ci/group_spec.rb
spec/models/ci/group_spec.rb
+1
-1
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+6
-6
spec/services/users/destroy_service_spec.rb
spec/services/users/destroy_service_spec.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
71b55808
...
...
@@ -269,14 +269,6 @@ RSpec/ScatteredSetup:
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/services/projects/create_service_spec.rb'
# Offense count: 4
RSpec/VoidExpect
:
Exclude
:
-
'
spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb'
-
'
spec/models/ci/group_spec.rb'
-
'
spec/models/ci/runner_spec.rb'
-
'
spec/services/users/destroy_service_spec.rb'
# Offense count: 10
# Cop supports --auto-correct.
Rails/ApplicationController
:
...
...
spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb
View file @
71b55808
...
...
@@ -174,7 +174,7 @@ describe 'Set up Mattermost slash commands', :js do
describe
'stable logo url'
do
it
'shows a publicly available logo'
do
expect
(
File
.
exist?
(
Rails
.
root
.
join
(
'public/slash-command-logo.png'
)))
expect
(
File
.
exist?
(
Rails
.
root
.
join
(
'public/slash-command-logo.png'
)))
.
to
be_truthy
end
end
end
spec/models/ci/group_spec.rb
View file @
71b55808
...
...
@@ -53,7 +53,7 @@ describe Ci::Group do
it
'calls the status from the object itself'
do
expect
(
jobs
.
first
).
to
receive
(
:detailed_status
)
expect
(
subject
.
detailed_status
(
double
(
:user
)
))
subject
.
detailed_status
(
double
(
:user
))
end
end
...
...
spec/models/ci/runner_spec.rb
View file @
71b55808
...
...
@@ -526,14 +526,14 @@ describe Ci::Runner do
it
'sets a new last_update value when it is called the first time'
do
last_update
=
runner
.
ensure_runner_queue_value
expect
_value_in_queues
.
to
eq
(
last_update
)
expect
(
value_in_queues
)
.
to
eq
(
last_update
)
end
it
'does not change if it is not expired and called again'
do
last_update
=
runner
.
ensure_runner_queue_value
expect
(
runner
.
ensure_runner_queue_value
).
to
eq
(
last_update
)
expect
_value_in_queues
.
to
eq
(
last_update
)
expect
(
value_in_queues
)
.
to
eq
(
last_update
)
end
context
'updates runner queue after changing editable value'
do
...
...
@@ -544,7 +544,7 @@ describe Ci::Runner do
end
it
'sets a new last_update value'
do
expect
_value_in_queues
.
not_to
eq
(
last_update
)
expect
(
value_in_queues
)
.
not_to
eq
(
last_update
)
end
end
...
...
@@ -556,14 +556,14 @@ describe Ci::Runner do
end
it
'has an old last_update value'
do
expect
_value_in_queues
.
to
eq
(
last_update
)
expect
(
value_in_queues
)
.
to
eq
(
last_update
)
end
end
def
expect_
value_in_queues
def
value_in_queues
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
runner_queue_key
=
runner
.
send
(
:runner_queue_key
)
expect
(
redis
.
get
(
runner_queue_key
)
)
redis
.
get
(
runner_queue_key
)
end
end
end
...
...
spec/services/users/destroy_service_spec.rb
View file @
71b55808
...
...
@@ -15,7 +15,7 @@ describe Users::DestroyService do
it
'deletes the user'
do
user_data
=
service
.
execute
(
user
)
expect
{
user_data
[
'email'
].
to
eq
(
user
.
email
)
}
expect
(
user_data
[
'email'
]).
to
eq
(
user
.
email
)
expect
{
User
.
find
(
user
.
id
)
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
expect
{
Namespace
.
find
(
namespace
.
id
)
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
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