Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'seeds_helper'
module CodeOcean

View File

@ -1,8 +1,10 @@
# frozen_string_literal: true
FactoryBot.define do
factory :codeharbor_link do
user { build(:teacher) }
push_url { 'http://push.url' }
check_uuid_url { 'http://check-uuid.url' }
sequence(:api_key) { |n| "api_key#{n}" }
sequence(:api_key) {|n| "api_key#{n}" }
end
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :consumer do
name { 'openHPI' }

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
FactoryBot.define do
factory :error_template_attribute do
key { "MyString" }
regex { "MyString" }
key { 'MyString' }
regex { 'MyString' }
end
end

View File

@ -1,7 +1,9 @@
# frozen_string_literal: true
FactoryBot.define do
factory :error_template do
association :execution_environment, factory: :ruby
name { "MyString" }
signature { "MyString" }
name { 'MyString' }
signature { 'MyString' }
end
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :coffee_script, class: 'ExecutionEnvironment' do
created_by_teacher

View File

@ -4,13 +4,13 @@ require 'seeds_helper'
def create_seed_file(exercise, path, file_attributes = {})
file_extension = File.extname(path)
file_type = FactoryBot.create(file_attributes[:file_type] || :"dot_#{file_extension.gsub('.', '')}")
file_type = FactoryBot.create(file_attributes[:file_type] || :"dot_#{file_extension.delete('.')}")
name = File.basename(path).gsub(file_extension, '')
file_attributes.merge!(file_type: file_type, name: name, path: path.split('/')[1..-2].join('/'), role: file_attributes[:role] || 'regular_file')
if file_type.binary?
file_attributes.merge!(native_file: File.open(SeedsHelper.seed_file_path(path), 'r'))
file_attributes[:native_file] = File.open(SeedsHelper.seed_file_path(path), 'r')
else
file_attributes.merge!(content: SeedsHelper.read_seed_file(path))
file_attributes[:content] = SeedsHelper.read_seed_file(path)
end
exercise.add_file!(file_attributes)
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :external_user do
association :consumer

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :dot_coffee, class: 'FileType' do
created_by_admin

View File

@ -1,10 +1,11 @@
FactoryBot.define do
# frozen_string_literal: true
FactoryBot.define do
LTI_PARAMETERS = {
lis_result_sourcedid: "c2db0c7c-4411-4b27-a52b-ddfc3dc32065",
lis_outcome_service_url: "http://172.16.54.235:3000/courses/0132156a-9afb-434d-83cc-704780104105/sections/21c6c6f4-1fb6-43b4-af3c-04fdc098879e/items/999b1fe6-d4b6-47b7-a577-ea2b4b1041ec/tool_grading",
launch_presentation_return_url: "http://172.16.54.235:3000/courses/0132156a-9afb-434d-83cc-704780104105/sections/21c6c6f4-1fb6-43b4-af3c-04fdc098879e/items/999b1fe6-d4b6-47b7-a577-ea2b4b1041ec/tool_return"
}
lis_result_sourcedid: 'c2db0c7c-4411-4b27-a52b-ddfc3dc32065',
lis_outcome_service_url: 'http://172.16.54.235:3000/courses/0132156a-9afb-434d-83cc-704780104105/sections/21c6c6f4-1fb6-43b4-af3c-04fdc098879e/items/999b1fe6-d4b6-47b7-a577-ea2b4b1041ec/tool_grading',
launch_presentation_return_url: 'http://172.16.54.235:3000/courses/0132156a-9afb-434d-83cc-704780104105/sections/21c6c6f4-1fb6-43b4-af3c-04fdc098879e/items/999b1fe6-d4b6-47b7-a577-ea2b4b1041ec/tool_return',
}.freeze
factory :lti_parameter do
association :consumer

View File

@ -1,8 +1,9 @@
# frozen_string_literal: true
FactoryBot.define do
factory :proxy_exercise, class: 'ProxyExercise' do
created_by_teacher
token { 'dummytoken' }
title { 'Dummy' }
end
end

View File

@ -1,12 +1,14 @@
# frozen_string_literal: true
FactoryBot.define do
[:admin, :external_user, :teacher].each do |factory_name|
%i[admin external_user teacher].each do |factory_name|
trait :"created_by_#{factory_name}" do
association :user, factory: factory_name
end
end
trait :generated_email do
email { "#{name.underscore.gsub(' ', '.')}@example.org" }
email { "#{name.underscore.tr(' ', '.')}@example.org" }
end
trait :generated_user_name do

View File

@ -1,7 +1,9 @@
# frozen_string_literal: true
FactoryBot.define do
factory :structured_error_attribute do
association :structured_error
association :error_template_attribute
value { "MyString" }
value { 'MyString' }
end
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :structured_error do
association :error_template

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :study_group, class: 'StudyGroup' do
association :consumer

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :submission do
cause { 'save' }

View File

@ -1,8 +1,9 @@
# frozen_string_literal: true
FactoryBot.define do
factory :user_exercise_feedback, class: 'UserExerciseFeedback' do
created_by_external_user
feedback_text { 'Most suitable exercise ever' }
association :exercise, factory: :math
end
end