Skip to content

Commit

Permalink
Merge pull request #901 from PlanoramaEvents/fix-test-seed-data
Browse files Browse the repository at this point in the history
Fix the seed data for test surveys
  • Loading branch information
balen authored Nov 25, 2023
2 parents fc2a56f + 06ad923 commit 25c3dfb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
9 changes: 6 additions & 3 deletions db/seeds/development/survey.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,24 @@
question_type: :textbox,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 0
)
survey_question2 = Survey::Question.create(
question: "Are your pants on fire?",
question_type: :textfield,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 1
)
survey_question3 = Survey::Question.create(
question: "What is the meaning of life?",
question_type: :multiplechoice,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page2.id
page_id: survey_page2.id,
sort_order: 2
)
Survey::Answer.create(
question_id: survey_question3.id,
Expand Down
21 changes: 14 additions & 7 deletions db/seeds/test/survey.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,24 @@
question_type: :textfield,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 0
)
survey_question2 = Survey::Question.create(
question: "What is your quest?",
question_type: :textfield,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 1
)
survey_question3 = Survey::Question.create(
question: "What is the air speed velocity of an unladen swallow?",
question_type: :singlechoice,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page2.id
page_id: survey_page2.id,
sort_order: 2
)
Survey::Answer.create(
question_id: survey_question3.id,
Expand Down Expand Up @@ -124,21 +127,24 @@
question_type: :textbox,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 0
)
survey_question2 = Survey::Question.create(
question: "Are your pants on fire?",
question_type: :textfield,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 1
)
survey_question3 = Survey::Question.create(
question: "What is the meaning of life?",
question_type: :multiplechoice,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page2.id
page_id: survey_page2.id,
sort_order: 20
)
Survey::Answer.create(
question_id: survey_question3.id,
Expand Down Expand Up @@ -191,7 +197,8 @@
question_type: question_type,
text_size: Faker::Number.between(from: 11, to: 16),
horizontal: Faker::Boolean.boolean,
page_id: survey_page.id
page_id: survey_page.id,
sort_order: 0
)
case
when :singlechoice, :multiplechoice, :dropdown
Expand Down

0 comments on commit 25c3dfb

Please sign in to comment.