discourse/plugins/poll/spec/fabricators/poll_fabricator.rb
Robert bae492efee
FEATURE: Add Ranked Choice Voting
using Instant Run-off Voting algorithm to Poll Plugin (Part 2 add Ranked Choice)

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-07-17 11:49:14 +02:00

25 lines
500 B
Ruby

# frozen_string_literal: true
Fabricator(:poll) do
post
name { sequence(:name) { |i| "Poll #{i}" } }
end
Fabricator(:poll_regular, from: :poll) { type "regular" }
Fabricator(:poll_multiple, from: :poll) { type "multiple" }
Fabricator(:poll_ranked_choice, from: :poll) { type "ranked_choice" }
Fabricator(:poll_option) do
poll
html { sequence(:html) { |i| "Poll Option #{i}" } }
digest { sequence(:digest) { |i| "#{i}" } }
end
Fabricator(:poll_vote) do
poll
poll_option
user
end