Dont use faker gem on simulate successful proposal rake
This commit is contained in:
@@ -411,9 +411,8 @@ namespace :proposal_actions do
|
|||||||
goal_votes = Setting["votes_for_proposal_success"].to_f
|
goal_votes = Setting["votes_for_proposal_success"].to_f
|
||||||
cached_votes_up = 0
|
cached_votes_up = 0
|
||||||
|
|
||||||
tags = Faker::Lorem.words(25)
|
|
||||||
author = User.all.sample
|
author = User.all.sample
|
||||||
description = "<p>#{Faker::Lorem.paragraphs.join('</p><p>')}</p>"
|
description = "<p>This is an example of a successful proposal with an ideal progress.</p>"
|
||||||
proposal = Proposal.create!(author: author,
|
proposal = Proposal.create!(author: author,
|
||||||
title: Faker::Lorem.sentence(3).truncate(60),
|
title: Faker::Lorem.sentence(3).truncate(60),
|
||||||
question: Faker::Lorem.sentence(3) + "?",
|
question: Faker::Lorem.sentence(3) + "?",
|
||||||
@@ -422,13 +421,12 @@ namespace :proposal_actions do
|
|||||||
external_url: Faker::Internet.url,
|
external_url: Faker::Internet.url,
|
||||||
description: description,
|
description: description,
|
||||||
created_at: Time.now - expected_supports.length.days,
|
created_at: Time.now - expected_supports.length.days,
|
||||||
tag_list: tags.sample(3).join(","),
|
tag_list: "Example",
|
||||||
geozone: Geozone.all.sample,
|
geozone: Geozone.all.sample,
|
||||||
skip_map: "1",
|
skip_map: "1",
|
||||||
terms_of_service: "1",
|
terms_of_service: "1",
|
||||||
published_at: Time.now - expected_supports.length.days)
|
published_at: Time.now - expected_supports.length.days)
|
||||||
|
|
||||||
|
|
||||||
expected_supports.each_with_index do |supports, day_offset|
|
expected_supports.each_with_index do |supports, day_offset|
|
||||||
supports = (supports * goal_votes / votes_count).ceil
|
supports = (supports * goal_votes / votes_count).ceil
|
||||||
cached_votes_up += supports
|
cached_votes_up += supports
|
||||||
|
|||||||
Reference in New Issue
Block a user