mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 19:13:38 +08:00
1384ba5a4e
Cater for polls that can have multiple votes per user. This fixes an older UserMerge and migration which was intended to de-duplicate poll votes but did not account for "multiple" type polls.
23 lines
429 B
Ruby
23 lines
429 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_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
|