rename factory_girl_(rails) to factory_bot_(rails)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
require 'seeds_helper'
|
||||
|
||||
module CodeOcean
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :file, class: CodeOcean::File do
|
||||
content ''
|
||||
association :context, factory: :submission
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :consumer do
|
||||
name 'openHPI'
|
||||
oauth_key { SecureRandom.hex }
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :error, class: Error do
|
||||
association :execution_environment, factory: :ruby
|
||||
message "exercise.rb:4:in `<main>': undefined local variable or method `foo' for main:Object (NameError)"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :coffee_script, class: ExecutionEnvironment do
|
||||
created_by_teacher
|
||||
default_memory_limit
|
||||
|
@@ -2,7 +2,7 @@ require 'seeds_helper'
|
||||
|
||||
def create_seed_file(exercise, path, file_attributes = {})
|
||||
file_extension = File.extname(path)
|
||||
file_type = FactoryGirl.create(file_attributes[:file_type] || :"dot_#{file_extension.gsub('.', '')}")
|
||||
file_type = FactoryBot.create(file_attributes[:file_type] || :"dot_#{file_extension.gsub('.', '')}")
|
||||
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?
|
||||
@@ -13,7 +13,7 @@ def create_seed_file(exercise, path, file_attributes = {})
|
||||
exercise.add_file!(file_attributes)
|
||||
end
|
||||
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :audio_video, class: Exercise do
|
||||
created_by_teacher
|
||||
description "Try HTML's audio and video capabilities."
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :external_user do
|
||||
association :consumer
|
||||
generated_email
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :dot_coffee, class: FileType do
|
||||
created_by_admin
|
||||
editor_mode 'ace/mode/coffee'
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :node_js_invalid_assignment, class: Hint do
|
||||
association :execution_environment, factory: :node_js
|
||||
english
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :admin, class: InternalUser do
|
||||
activated_user
|
||||
email 'admin@example.org'
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
|
||||
LTI_PARAMETERS = {
|
||||
lis_result_sourcedid: "c2db0c7c-4411-4b27-a52b-ddfc3dc32065",
|
||||
@@ -17,4 +17,4 @@ FactoryGirl.define do
|
||||
lti_parameters LTI_PARAMETERS.except(:lis_outcome_service_url)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :proxy_exercise, class: ProxyExercise do
|
||||
token 'dummytoken'
|
||||
title 'Dummy'
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
[:admin, :external_user, :teacher].each do |factory_name|
|
||||
trait :"created_by_#{factory_name}" do
|
||||
association :user, factory: factory_name
|
||||
|
@@ -1,4 +1,4 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :submission do
|
||||
cause 'save'
|
||||
created_by_external_user
|
||||
|
@@ -1,7 +1,7 @@
|
||||
FactoryGirl.define do
|
||||
FactoryBot.define do
|
||||
factory :user_exercise_feedback, class: UserExerciseFeedback do
|
||||
created_by_external_user
|
||||
feedback_text 'Most suitable exercise ever'
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user