Fix Rubocop offenses

This commit is contained in:
Sebastian Serth
2022-10-24 12:10:10 +02:00
parent b32bf1232b
commit c75f52f2c8
20 changed files with 222 additions and 222 deletions

View File

@ -2,7 +2,7 @@
require 'rails_helper'
RSpec.describe PingController, type: :controller do
RSpec.describe PingController do
describe 'index' do
it 'returns the wanted page and answer with HTTP Status 200' do
get :index

View File

@ -29,6 +29,6 @@ describe 'Request_for_Comments' do
it 'contains a filter for study group in the view' do
visit(request_for_comments_path)
expect(page.find_by_id('q_submission_study_group_id_in')).not_to be_nil # rubocop:disable Rails/DynamicFindBy
expect(page.find_by_id('q_submission_study_group_id_in')).not_to be_nil
end
end

View File

@ -5,7 +5,7 @@ require 'pathname'
describe Runner::Strategy::DockerContainerPool do
let(:runner_id) { attributes_for(:runner)[:runner_id] }
let(:execution_environment) { create :ruby }
let(:execution_environment) { create(:ruby) }
let(:container_pool) { described_class.new(runner_id, execution_environment) }
let(:docker_container_pool_url) { 'https://localhost:1234' }
let(:config) { {url: docker_container_pool_url, unused_runner_expiration_time: 180} }

View File

@ -4,7 +4,7 @@ require 'rails_helper'
describe Runner::Strategy::Poseidon do
let(:runner_id) { attributes_for(:runner)[:runner_id] }
let(:execution_environment) { create :ruby }
let(:execution_environment) { create(:ruby) }
let(:poseidon) { described_class.new(runner_id, execution_environment) }
let(:error_message) { 'test error message' }
let(:response_body) { nil }

View File

@ -8,7 +8,7 @@ describe Runner do
let(:strategy) { instance_double(strategy_class) }
describe 'attribute validation' do
let(:runner) { create :runner }
let(:runner) { create(:runner) }
it 'validates the presence of the runner id' do
described_class.skip_callback(:validation, :before, :request_id)
@ -164,8 +164,8 @@ describe Runner do
end
describe 'creation' do
let(:user) { create :external_user }
let(:execution_environment) { create :ruby }
let(:user) { create(:external_user) }
let(:execution_environment) { create(:ruby) }
let(:create_action) { -> { described_class.create(user: user, execution_environment: execution_environment) } }
it 'requests a runner id from the runner management' do
@ -194,7 +194,7 @@ describe Runner do
end
describe '#request_new_id' do
let(:runner) { create :runner }
let(:runner) { create(:runner) }
context 'when the environment is available in the runner management' do
it 'requests the runner management' do
@ -242,8 +242,8 @@ describe Runner do
end
describe '::for' do
let(:user) { create :external_user }
let(:exercise) { create :fibonacci }
let(:user) { create(:external_user) }
let(:exercise) { create(:fibonacci) }
context 'when the runner could not be saved' do
before { allow(strategy_class).to receive(:request_from_management).and_return(nil) }

View File

@ -126,7 +126,7 @@ describe Submission do
end
describe '#calculate_score' do
let(:runner) { create :runner }
let(:runner) { create(:runner) }
before do
allow(Runner).to receive(:for).and_return(runner)

View File

@ -2,7 +2,7 @@
require 'rails_helper'
describe PingController, type: :routing do
describe PingController do
context 'with routes to #show' do
it { expect(get: '/ping').to route_to('ping#index', format: :json) }
end