Hide FactoryBot deprecation warning by changing static assignment

Signed-off-by: Sebastian Serth <Sebastian.Serth@student.hpi.de>
This commit is contained in:
Sebastian Serth
2018-09-11 10:53:58 +02:00
parent ac31afbd2a
commit 1f12b39731
12 changed files with 217 additions and 217 deletions

View File

@ -3,13 +3,13 @@ require 'seeds_helper'
module CodeOcean
FactoryBot.define do
factory :file, class: CodeOcean::File do
content ''
content { '' }
association :context, factory: :submission
association :file_type, factory: :dot_rb
hidden false
hidden { false }
name { SecureRandom.hex }
read_only false
role 'main_file'
read_only { false }
role { 'main_file' }
end
end
end

View File

@ -1,6 +1,6 @@
FactoryBot.define do
factory :consumer do
name 'openHPI'
name { 'openHPI' }
oauth_key { SecureRandom.hex }
oauth_secret { SecureRandom.hex }
singleton_consumer

View File

@ -1,6 +1,6 @@
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)"
message { "exercise.rb:4:in `<main>': undefined local variable or method `foo' for main:Object (NameError)" }
end
end

View File

@ -2,146 +2,146 @@ FactoryBot.define do
factory :coffee_script, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-coffee:latest'
docker_image { 'hklement/ubuntu-coffee:latest' }
association :file_type, factory: :dot_coffee
help
name 'CoffeeScript'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'coffee'
name { 'CoffeeScript' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'coffee' }
singleton_execution_environment
end
factory :html, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-html:latest'
docker_image { 'hklement/ubuntu-html:latest' }
association :file_type, factory: :dot_html
help
name 'HTML5'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'touch'
name { 'HTML5' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'touch' }
singleton_execution_environment
test_command 'rspec %{filename} --format documentation'
testing_framework 'RspecAdapter'
test_command { 'rspec %{filename} --format documentation' }
testing_framework { 'RspecAdapter' }
end
factory :java, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'openhpi/co_execenv_java:latest'
docker_image { 'openhpi/co_execenv_java:latest' }
association :file_type, factory: :dot_java
help
name 'Java 8'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'make run'
name { 'Java 8' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'make run' }
singleton_execution_environment
test_command 'make test CLASS_NAME="%{class_name}" FILENAME="%{filename}"'
testing_framework 'JunitAdapter'
test_command { 'make test CLASS_NAME="%{class_name}" FILENAME="%{filename}"' }
testing_framework { 'JunitAdapter' }
end
factory :jruby, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-jruby:latest'
docker_image { 'hklement/ubuntu-jruby:latest' }
association :file_type, factory: :dot_rb
help
name 'JRuby 1.7'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'jruby %{filename}'
name { 'JRuby 1.7' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'jruby %{filename}' }
singleton_execution_environment
test_command 'rspec %{filename} --format documentation'
testing_framework 'RspecAdapter'
test_command { 'rspec %{filename} --format documentation' }
testing_framework { 'RspecAdapter' }
end
factory :node_js, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-node:latest'
docker_image { 'hklement/ubuntu-node:latest' }
association :file_type, factory: :dot_js
help
name 'Node.js'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'node %{filename}'
name { 'Node.js' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'node %{filename}' }
singleton_execution_environment
end
factory :python, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'openhpi/co_execenv_python:latest'
docker_image { 'openhpi/co_execenv_python:latest' }
association :file_type, factory: :dot_py
help
name 'Python 3.4'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'python3 %{filename}'
name { 'Python 3.4' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'python3 %{filename}' }
singleton_execution_environment
test_command 'python3 -m unittest --verbose %{module_name}'
testing_framework 'PyUnitAdapter'
test_command { 'python3 -m unittest --verbose %{module_name}' }
testing_framework { 'PyUnitAdapter' }
end
factory :ruby, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-ruby:latest'
docker_image { 'hklement/ubuntu-ruby:latest' }
association :file_type, factory: :dot_rb
help
name 'Ruby 2.2'
network_enabled false
permitted_execution_time 10.seconds
pool_size 0
run_command 'ruby %{filename}'
name { 'Ruby 2.2' }
network_enabled { false }
permitted_execution_time { 10.seconds }
pool_size { 0 }
run_command { 'ruby %{filename}' }
singleton_execution_environment
test_command 'rspec %{filename} --format documentation'
testing_framework 'RspecAdapter'
test_command { 'rspec %{filename} --format documentation' }
testing_framework { 'RspecAdapter' }
end
factory :sinatra, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-sinatra:latest'
docker_image { 'hklement/ubuntu-sinatra:latest' }
association :file_type, factory: :dot_rb
exposed_ports '4567'
exposed_ports { '4567' }
help
name 'Sinatra'
network_enabled true
permitted_execution_time 15.minutes
pool_size 0
run_command 'ruby %{filename}'
name { 'Sinatra' }
network_enabled { true }
permitted_execution_time { 15.minutes }
pool_size { 0 }
run_command { 'ruby %{filename}' }
singleton_execution_environment
test_command 'rspec %{filename} --format documentation'
testing_framework 'RspecAdapter'
test_command { 'rspec %{filename} --format documentation' }
testing_framework { 'RspecAdapter' }
end
factory :sqlite, class: ExecutionEnvironment do
created_by_teacher
default_memory_limit
docker_image 'hklement/ubuntu-sqlite:latest'
docker_image { 'hklement/ubuntu-sqlite:latest' }
association :file_type, factory: :dot_sql
help
name 'SQLite'
network_enabled false
permitted_execution_time 1.minute
pool_size 0
run_command 'sqlite3 /database.db -init %{filename} -html'
name { 'SQLite' }
network_enabled { false }
permitted_execution_time { 1.minute }
pool_size { 0 }
run_command { 'sqlite3 /database.db -init %{filename} -html' }
singleton_execution_environment
test_command 'ruby %{filename}'
testing_framework 'SqlResultSetComparatorAdapter'
test_command { 'ruby %{filename}' }
testing_framework { 'SqlResultSetComparatorAdapter' }
end
trait :default_memory_limit do
memory_limit DockerClient::DEFAULT_MEMORY_LIMIT
memory_limit { DockerClient::DEFAULT_MEMORY_LIMIT }
end
trait :help do

View File

@ -16,10 +16,10 @@ end
FactoryBot.define do
factory :audio_video, class: Exercise do
created_by_teacher
description "Try HTML's audio and video capabilities."
description { "Try HTML's audio and video capabilities." }
association :execution_environment, factory: :html
instructions 'Build a simple website including an HTML <audio> and <video> element. Link the following media files: chai.ogg, devstories.mp4.'
title 'Audio & Video'
instructions { 'Build a simple website including an HTML <audio> and <video> element. Link the following media files: chai.ogg, devstories.mp4.' }
title { 'Audio & Video' }
after(:create) do |exercise|
create_seed_file(exercise, 'audio_video/index.html', role: 'main_file')
@ -34,16 +34,16 @@ FactoryBot.define do
factory :dummy, class: Exercise do
created_by_teacher
description 'Dummy'
description { 'Dummy' }
association :execution_environment, factory: :ruby
instructions
title 'Dummy'
title { 'Dummy' }
factory :dummy_with_user_feedbacks do
# user_feedbacks_count is declared as a transient attribute and available in
# attributes on the factory, as well as the callback via the evaluator
transient do
user_feedbacks_count 5
user_feedbacks_count { 5 }
end
# the after(:create) yields two values; the exercise instance itself and the
@ -60,10 +60,10 @@ FactoryBot.define do
factory :even_odd, class: Exercise do
created_by_teacher
description 'Implement two methods even and odd which return whether a given number is even or odd, respectively.'
description { 'Implement two methods even and odd which return whether a given number is even or odd, respectively.' }
association :execution_environment, factory: :python
instructions
title 'Even/Odd'
title { 'Even/Odd' }
after(:create) do |exercise|
create_seed_file(exercise, 'even_odd/exercise.py', role: 'main_file')
@ -74,10 +74,10 @@ FactoryBot.define do
factory :fibonacci, class: Exercise do
created_by_teacher
description 'Implement a recursive function that calculates a requested Fibonacci number.'
description { 'Implement a recursive function that calculates a requested Fibonacci number.' }
association :execution_environment, factory: :ruby
instructions
title 'Fibonacci Sequence'
title { 'Fibonacci Sequence' }
after(:create) do |exercise|
create_seed_file(exercise, 'fibonacci/exercise.rb', role: 'main_file')
@ -90,10 +90,10 @@ FactoryBot.define do
factory :files, class: Exercise do
created_by_teacher
description 'Learn how to work with files.'
description { 'Learn how to work with files.' }
association :execution_environment, factory: :ruby
instructions
title 'Working with Files'
title { 'Working with Files' }
after(:create) do |exercise|
create_seed_file(exercise, 'files/data.txt', read_only: true)
@ -104,10 +104,10 @@ FactoryBot.define do
factory :geolocation, class: Exercise do
created_by_teacher
description "Use the HTML5 Geolocation API to get the user's geographical position."
description { "Use the HTML5 Geolocation API to get the user's geographical position." }
association :execution_environment, factory: :html
instructions
title 'Geolocation'
title { 'Geolocation' }
after(:create) do |exercise|
create_seed_file(exercise, 'geolocation/index.html', role: 'main_file')
@ -117,10 +117,10 @@ FactoryBot.define do
factory :hello_world, class: Exercise do
created_by_teacher
description "Write a simple 'Hello World' application."
description { "Write a simple 'Hello World' application." }
association :execution_environment, factory: :ruby
instructions
title 'Hello World'
title { 'Hello World' }
after(:create) do |exercise|
create_seed_file(exercise, 'hello_world/exercise.rb', role: 'main_file')
@ -130,10 +130,10 @@ FactoryBot.define do
factory :math, class: Exercise do
created_by_teacher
description 'Implement a recursive math library.'
description { 'Implement a recursive math library.' }
association :execution_environment, factory: :java
instructions
title 'Math'
title { 'Math' }
after(:create) do |exercise|
create_seed_file(exercise, 'math/Makefile', file_type: :makefile, hidden: true, role: 'regular_file')
@ -145,10 +145,10 @@ FactoryBot.define do
factory :primes, class: Exercise do
created_by_teacher
description 'Write a function that prints the first n prime numbers.'
description { 'Write a function that prints the first n prime numbers.' }
association :execution_environment, factory: :node_js
instructions
title 'Primes'
title { 'Primes' }
after(:create) do |exercise|
create_seed_file(exercise, 'primes/exercise.js', role: 'main_file')
@ -157,10 +157,10 @@ FactoryBot.define do
factory :sql_select, class: Exercise do
created_by_teacher
description 'Learn to use the SELECT statement.'
description { 'Learn to use the SELECT statement.' }
association :execution_environment, factory: :sqlite
instructions "Write a query which selects the full rows for all people with the last name 'Doe'."
title 'SELECT'
instructions { "Write a query which selects the full rows for all people with the last name 'Doe'." }
title { 'SELECT' }
after(:create) do |exercise|
create_seed_file(exercise, 'sql_select/exercise.sql', role: 'main_file')
@ -171,10 +171,10 @@ FactoryBot.define do
factory :tdd, class: Exercise do
created_by_teacher
description 'Learn to appreciate test-driven development.'
description { 'Learn to appreciate test-driven development.' }
association :execution_environment, factory: :ruby
instructions SeedsHelper.read_seed_file('tdd/instructions.md')
title 'Test-driven Development'
instructions { SeedsHelper.read_seed_file('tdd/instructions.md') }
title { 'Test-driven Development' }
after(:create) do |exercise|
create_seed_file(exercise, 'tdd/exercise.rb', role: 'main_file')
@ -184,10 +184,10 @@ FactoryBot.define do
factory :web_app, class: Exercise do
created_by_teacher
description 'Build a simple Web application with Sinatra.'
description { 'Build a simple Web application with Sinatra.' }
association :execution_environment, factory: :sinatra
instructions
title 'A Simple Web Application'
title { 'A Simple Web Application' }
after(:create) do |exercise|
create_seed_file(exercise, 'web_app/app.rb', role: 'main_file')

View File

@ -1,86 +1,86 @@
FactoryBot.define do
factory :dot_coffee, class: FileType do
created_by_admin
editor_mode 'ace/mode/coffee'
editor_mode { 'ace/mode/coffee' }
executable
file_extension '.coffee'
indent_size 2
name 'CoffeeScript'
file_extension { '.coffee' }
indent_size { 2 }
name { 'CoffeeScript' }
singleton_file_type
end
factory :dot_gif, class: FileType do
binary
created_by_admin
file_extension '.gif'
name 'GIF'
file_extension { '.gif' }
name { 'GIF' }
renderable
singleton_file_type
end
factory :dot_html, class: FileType do
created_by_admin
editor_mode 'ace/mode/html'
file_extension '.html'
indent_size 4
name 'HTML'
editor_mode { 'ace/mode/html' }
file_extension { '.html' }
indent_size { 4 }
name { 'HTML' }
renderable
singleton_file_type
end
factory :dot_java, class: FileType do
created_by_admin
editor_mode 'ace/mode/java'
editor_mode { 'ace/mode/java' }
executable
file_extension '.java'
indent_size 4
name 'Java'
file_extension { '.java' }
indent_size { 4 }
name { 'Java' }
singleton_file_type
end
factory :dot_jpg, class: FileType do
binary
created_by_admin
file_extension '.jpg'
name 'JPEG'
file_extension { '.jpg' }
name { 'JPEG' }
renderable
singleton_file_type
end
factory :dot_js, class: FileType do
created_by_admin
editor_mode 'ace/mode/javascript'
editor_mode { 'ace/mode/javascript' }
executable
file_extension '.js'
indent_size 4
name 'JavaScript'
file_extension { '.js' }
indent_size { 4 }
name { 'JavaScript' }
singleton_file_type
end
factory :dot_json, class: FileType do
created_by_admin
editor_mode 'ace/mode/javascript'
file_extension '.json'
indent_size 4
name 'JSON'
editor_mode { 'ace/mode/javascript' }
file_extension { '.json' }
indent_size { 4 }
name { 'JSON' }
renderable
singleton_file_type
end
factory :dot_md, class: FileType do
created_by_admin
editor_mode 'ace/mode/markdown'
file_extension '.md'
indent_size 2
name 'Markdown'
editor_mode { 'ace/mode/markdown' }
file_extension { '.md' }
indent_size { 2 }
name { 'Markdown' }
singleton_file_type
end
factory :dot_mp3, class: FileType do
binary
created_by_admin
file_extension '.mp3'
name 'MP3'
file_extension { '.mp3' }
name { 'MP3' }
renderable
singleton_file_type
end
@ -88,8 +88,8 @@ FactoryBot.define do
factory :dot_mp4, class: FileType do
binary
created_by_admin
file_extension '.mp4'
name 'MPEG-4'
file_extension { '.mp4' }
name { 'MPEG-4' }
renderable
singleton_file_type
end
@ -97,8 +97,8 @@ FactoryBot.define do
factory :dot_ogg, class: FileType do
binary
created_by_admin
file_extension '.ogg'
name 'Ogg Vorbis'
file_extension { '.ogg' }
name { 'Ogg Vorbis' }
renderable
singleton_file_type
end
@ -106,58 +106,58 @@ FactoryBot.define do
factory :dot_png, class: FileType do
binary
created_by_admin
file_extension '.png'
name 'PNG'
file_extension { '.png' }
name { 'PNG' }
renderable
singleton_file_type
end
factory :dot_py, class: FileType do
created_by_admin
editor_mode 'ace/mode/python'
editor_mode { 'ace/mode/python' }
executable
file_extension '.py'
indent_size 4
name 'Python'
file_extension { '.py' }
indent_size { 4 }
name { 'Python' }
singleton_file_type
end
factory :dot_rb, class: FileType do
created_by_admin
editor_mode 'ace/mode/ruby'
editor_mode { 'ace/mode/ruby' }
executable
file_extension '.rb'
indent_size 2
name 'Ruby'
file_extension { '.rb' }
indent_size { 2 }
name { 'Ruby' }
singleton_file_type
end
factory :dot_svg, class: FileType do
created_by_admin
editor_mode 'ace/mode/svg'
file_extension '.svg'
indent_size 4
name 'SVG'
editor_mode { 'ace/mode/svg' }
file_extension { '.svg' }
indent_size { 4 }
name { 'SVG' }
renderable
singleton_file_type
end
factory :dot_sql, class: FileType do
created_by_admin
editor_mode 'ace/mode/sql'
editor_mode { 'ace/mode/sql' }
executable
file_extension '.sql'
indent_size 4
name 'SQL'
file_extension { '.sql' }
indent_size { 4 }
name { 'SQL' }
singleton_file_type
end
factory :dot_txt, class: FileType do
created_by_admin
editor_mode 'ace/mode/plain_text'
file_extension '.txt'
indent_size 4
name 'Plain Text'
editor_mode { 'ace/mode/plain_text' }
file_extension { '.txt' }
indent_size { 4 }
name { 'Plain Text' }
renderable
singleton_file_type
end
@ -165,28 +165,28 @@ FactoryBot.define do
factory :dot_webm, class: FileType do
binary
created_by_admin
file_extension '.webm'
name 'WebM'
file_extension { '.webm' }
name { 'WebM' }
renderable
singleton_file_type
end
factory :dot_xml, class: FileType do
created_by_admin
editor_mode 'ace/mode/xml'
file_extension '.xml'
indent_size 4
name 'XML'
editor_mode { 'ace/mode/xml' }
file_extension { '.xml' }
indent_size { 4 }
name { 'XML' }
renderable
singleton_file_type
end
factory :makefile, class: FileType do
created_by_admin
editor_mode 'ace/mode/makefile'
editor_mode { 'ace/mode/makefile' }
executable
indent_size 2
name 'Makefile'
indent_size { 2 }
name { 'Makefile' }
singleton_file_type
end

View File

@ -2,100 +2,100 @@ FactoryBot.define do
factory :node_js_invalid_assignment, class: Hint do
association :execution_environment, factory: :node_js
english
message 'There was an error with an assignment. Maybe you have to use the equality operator here.'
name 'Invalid assignment'
regular_expression 'Invalid left-hand side in assignment'
message { 'There was an error with an assignment. Maybe you have to use the equality operator here.' }
name { 'Invalid assignment' }
regular_expression { 'Invalid left-hand side in assignment' }
end
factory :node_js_reference_error, class: Hint do
association :execution_environment, factory: :node_js
english
message "'$1' is not defined."
name 'ReferenceError'
regular_expression 'ReferenceError: (\w+) is not defined'
message { "'$1' is not defined." }
name { 'ReferenceError' }
regular_expression { 'ReferenceError: (\w+) is not defined' }
end
factory :node_js_syntax_error, class: Hint do
association :execution_environment, factory: :node_js
english
message 'You seem to have made a typo.'
name 'SyntaxError'
regular_expression 'SyntaxError: Unexpected token (\w+)'
message { 'You seem to have made a typo.' }
name { 'SyntaxError' }
regular_expression { 'SyntaxError: Unexpected token (\w+)' }
end
factory :ruby_load_error, class: Hint do
association :execution_environment, factory: :ruby
english
message "The file '$1' cannot be found."
name 'LoadError'
regular_expression 'cannot load such file -- (\w+) (LoadError)'
message { "The file '$1' cannot be found." }
name { 'LoadError' }
regular_expression { 'cannot load such file -- (\w+) (LoadError)' }
end
factory :ruby_name_error_constant, class: Hint do
association :execution_environment, factory: :ruby
english
message "The constant '$1' is not defined."
name 'NameError (uninitialized constant)'
regular_expression 'uninitialized constant (\w+) \(NameError\)'
message { "The constant '$1' is not defined." }
name { 'NameError (uninitialized constant)' }
regular_expression { 'uninitialized constant (\w+) \(NameError\)' }
end
factory :ruby_name_error_variable, class: Hint do
association :execution_environment, factory: :ruby
english
message "Your object '$2' of class '$3' does not know what '$1' is. Maybe you made a typo or still have to define '$1'."
name 'NameError (undefined local variable or method)'
regular_expression 'undefined local variable or method `(\w+)\' for (\w+):(\w+) \(NameError\)'
message { "Your object '$2' of class '$3' does not know what '$1' is. Maybe you made a typo or still have to define '$1'." }
name { 'NameError (undefined local variable or method)' }
regular_expression { 'undefined local variable or method `(\w+)\' for (\w+):(\w+) \(NameError\)' }
end
factory :ruby_no_method_error, class: Hint do
association :execution_environment, factory: :ruby
english
message "Your object '$2' of class '$3' does not understand the method '$1'. Maybe you made a typo or still have to implement that method."
name 'NoMethodError'
regular_expression 'undefined method `([\w\!\?=\[\]]+)\' for (\w+):(\w+) \(NoMethodError\)'
message { "Your object '$2' of class '$3' does not understand the method '$1'. Maybe you made a typo or still have to implement that method." }
name { 'NoMethodError' }
regular_expression { 'undefined method `([\w\!\?=\[\]]+)\' for (\w+):(\w+) \(NoMethodError\)' }
end
factory :ruby_syntax_error, class: Hint do
association :execution_environment, factory: :ruby
english
message 'You seem to have made a typo.'
name 'SyntaxError'
regular_expression 'syntax error'
message { 'You seem to have made a typo.' }
name { 'SyntaxError' }
regular_expression { 'syntax error' }
end
factory :ruby_system_stack_error, class: Hint do
association :execution_environment, factory: :ruby
english
message 'You seem to have built an infinite loop or recursion.'
name 'SystemStackError'
regular_expression 'stack level too deep \(SystemStackError\)'
message { 'You seem to have built an infinite loop or recursion.' }
name { 'SystemStackError' }
regular_expression { 'stack level too deep \(SystemStackError\)' }
end
factory :sqlite_no_such_column, class: Hint do
association :execution_environment, factory: :sqlite
english
message "The column '$1' does not exist."
name 'No Such Column'
regular_expression 'no such column: (\w+)'
message { "The column '$1' does not exist." }
name { 'No Such Column' }
regular_expression { 'no such column: (\w+)' }
end
factory :sqlite_no_such_table, class: Hint do
association :execution_environment, factory: :sqlite
english
message "The table '$1' does not exist."
name 'No Such Table'
regular_expression 'no such table: (\w+)'
message { "The table '$1' does not exist." }
name { 'No Such Table' }
regular_expression { 'no such table: (\w+)' }
end
factory :sqlite_syntax_error, class: Hint do
association :execution_environment, factory: :sqlite
english
message "You seem to have made a typo near '$1'."
name 'SyntaxError'
regular_expression 'near "(\w+)": syntax error'
message { "You seem to have made a typo near '$1'." }
name { 'SyntaxError' }
regular_expression { 'near "(\w+)": syntax error' }
end
trait :english do
locale 'en'
locale { 'en' }
end
end

View File

@ -1,10 +1,10 @@
FactoryBot.define do
factory :admin, class: InternalUser do
activated_user
email 'admin@example.org'
email { 'admin@example.org' }
generated_user_name
password 'admin'
role 'admin'
password { 'admin' }
role { 'admin' }
singleton_internal_user
end
@ -13,8 +13,8 @@ FactoryBot.define do
association :consumer
generated_email
generated_user_name
password 'teacher'
role 'teacher'
password { 'teacher' }
role { 'teacher' }
singleton_internal_user
end

View File

@ -11,10 +11,10 @@ FactoryBot.define do
association :exercise, factory: :math
association :external_user
lti_parameters LTI_PARAMETERS
lti_parameters { LTI_PARAMETERS }
trait :without_outcome_service_url do
lti_parameters LTI_PARAMETERS.except(:lis_outcome_service_url)
lti_parameters { LTI_PARAMETERS.except(:lis_outcome_service_url) }
end
end
end

View File

@ -1,7 +1,7 @@
FactoryBot.define do
factory :proxy_exercise, class: ProxyExercise do
token 'dummytoken'
title 'Dummy'
token { 'dummytoken' }
title { 'Dummy' }
end
end

View File

@ -1,6 +1,6 @@
FactoryBot.define do
factory :submission do
cause 'save'
cause { 'save' }
created_by_external_user
association :exercise, factory: :math

View File

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