Commit 71b55808 authored by Igor Drozdov's avatar Igor Drozdov

Fix RSpec/VoidExpect offenses

parent fcf2ee20
......@@ -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:
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment