Apply automatic rubocop fixes
This commit is contained in:
@ -19,9 +19,9 @@ RSpec.describe ProformaService::ConvertExerciseToTask do
|
||||
let(:convert_to_task) { described_class.new(exercise: exercise) }
|
||||
let(:exercise) do
|
||||
FactoryBot.create(:dummy,
|
||||
instructions: 'instruction',
|
||||
uuid: SecureRandom.uuid,
|
||||
files: files + tests)
|
||||
instructions: 'instruction',
|
||||
uuid: SecureRandom.uuid,
|
||||
files: files + tests)
|
||||
end
|
||||
let(:files) { [] }
|
||||
let(:tests) { [] }
|
||||
|
@ -3,7 +3,7 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe ProformaService::ConvertTaskToExercise do
|
||||
# ToDo: Add teacher_defined_linter for tests
|
||||
# TODO: Add teacher_defined_linter for tests
|
||||
|
||||
describe '.new' do
|
||||
subject(:convert_to_exercise_service) { described_class.new(task: task, user: user, exercise: exercise) }
|
||||
@ -232,7 +232,7 @@ describe ProformaService::ConvertTaskToExercise do
|
||||
meta_data: {
|
||||
'feedback-message' => 'feedback-message',
|
||||
'testing-framework' => 'testing-framework',
|
||||
'testing-framework-version' => 'testing-framework-version'
|
||||
'testing-framework-version' => 'testing-framework-version',
|
||||
}
|
||||
)
|
||||
end
|
||||
@ -252,11 +252,11 @@ describe ProformaService::ConvertTaskToExercise do
|
||||
end
|
||||
|
||||
it 'creates an exercise with a test' do
|
||||
expect(convert_to_exercise_service.files.select { |file| file.role == 'teacher_defined_test' }).to have(1).item
|
||||
expect(convert_to_exercise_service.files.select {|file| file.role == 'teacher_defined_test' }).to have(1).item
|
||||
end
|
||||
|
||||
it 'creates an exercise with a test with correct attributes' do
|
||||
expect(convert_to_exercise_service.files.select { |file| file.role == 'teacher_defined_test' }.first).to have_attributes(
|
||||
expect(convert_to_exercise_service.files.find {|file| file.role == 'teacher_defined_test' }).to have_attributes(
|
||||
feedback_message: 'feedback-message',
|
||||
content: 'testfile-content',
|
||||
name: 'testfile',
|
||||
@ -275,7 +275,7 @@ describe ProformaService::ConvertTaskToExercise do
|
||||
meta_data: {
|
||||
'feedback-message' => 'feedback-message',
|
||||
'testing-framework' => 'testing-framework',
|
||||
'testing-framework-version' => 'testing-framework-version'
|
||||
'testing-framework-version' => 'testing-framework-version',
|
||||
}
|
||||
)
|
||||
end
|
||||
@ -294,7 +294,7 @@ describe ProformaService::ConvertTaskToExercise do
|
||||
end
|
||||
|
||||
it 'creates an exercise with two test' do
|
||||
expect(convert_to_exercise_service.files.select { |file| file.role == 'teacher_defined_test' }).to have(2).items
|
||||
expect(convert_to_exercise_service.files.select {|file| file.role == 'teacher_defined_test' }).to have(2).items
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -355,7 +355,7 @@ describe ProformaService::ConvertTaskToExercise do
|
||||
meta_data: {
|
||||
'feedback-message' => 'feedback-message',
|
||||
'testing-framework' => 'testing-framework',
|
||||
'testing-framework-version' => 'testing-framework-version'
|
||||
'testing-framework-version' => 'testing-framework-version',
|
||||
}
|
||||
)
|
||||
end
|
||||
|
@ -26,11 +26,11 @@ describe ProformaService::Import do
|
||||
let(:zip_file) { Tempfile.new('proforma_test_zip_file', encoding: 'ascii-8bit') }
|
||||
let(:exercise) do
|
||||
FactoryBot.create(:dummy,
|
||||
instructions: 'instruction',
|
||||
execution_environment: execution_environment,
|
||||
files: files + tests,
|
||||
uuid: uuid,
|
||||
user: user)
|
||||
instructions: 'instruction',
|
||||
execution_environment: execution_environment,
|
||||
files: files + tests,
|
||||
uuid: uuid,
|
||||
user: user)
|
||||
end
|
||||
|
||||
let(:uuid) {}
|
||||
@ -156,7 +156,7 @@ describe ProformaService::Import do
|
||||
let(:import_user) { FactoryBot.create(:teacher) }
|
||||
|
||||
it 'raises a proforma error' do
|
||||
expect { imported_exercise.save! } .to raise_error Proforma::ExerciseNotOwned
|
||||
expect { imported_exercise.save! }.to raise_error Proforma::ExerciseNotOwned
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user