Skip to content

Commit 4802288

Browse files
committed
Implemented factories for experiments, steps, texts
1 parent 4d78979 commit 4802288

4 files changed

Lines changed: 33 additions & 2 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
FactoryBot.define do
22
factory :experiment do
3+
title {Faker::StarTrek.character}
4+
description {Faker::TheFreshPrinceOfBelAir.quote}
5+
6+
factory :experiment_with_static_text do
7+
8+
factory :experiment_with_scene do
9+
10+
11+
factory :experiment_with_scene_test do
12+
13+
end
14+
end
15+
16+
17+
end
18+
19+
20+
21+
22+
323

424
end
525
end
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
FactoryBot.define do
22
factory :step do
3-
3+
title {Faker::StarTrek.character}
4+
description {Faker::TheFreshPrinceOfBelAir.quote}
5+
type "Step"
6+
factory :step_with_static_text do
7+
after(:create) do |step, evaluator|
8+
text = create(:text)
9+
step.textual_elements << text
10+
end
11+
end
412
end
513
end
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FactoryBot.define do
22
factory :text do
3-
3+
title {Faker::StarTrek.character}
4+
description {Faker::StarTrek.location}
5+
html {"<div>#{ Faker::TheFreshPrinceOfBelAir.quote}</div>"}
46
end
57
end

evaluationserver/spec/factories/textual_elements.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
factory :textual_element do
33

44
end
5+
56
end

0 commit comments

Comments
 (0)