-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #239 from TreinaDev/refactor/super-seed
Refactor do Superseed Co-authored-by: Gabriel Manika <[email protected]>
- Loading branch information
Showing
4 changed files
with
62 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
FactoryBot.define do | ||
def long_post | ||
'very big sentence' | ||
end | ||
|
||
factory :post do | ||
user | ||
title { Faker::Lorem.sentence } | ||
content { Faker::Lorem.paragraph sentence_count: rand(35..50) } | ||
content { Faker::Lorem.paragraph sentence_count: rand(2..12) } | ||
edited_at { Time.zone.now } | ||
|
||
trait :published do | ||
published_at { Time.zone.now } | ||
status { :published } | ||
end | ||
|
||
trait :seed do | ||
content do | ||
[ | ||
Faker::Lorem.paragraph(sentence_count: rand(4..18)), | ||
Faker::Lorem.paragraph(sentence_count: rand(2..18)), | ||
Faker::Lorem.paragraph(sentence_count: rand(4..18)), | ||
Faker::Lorem.paragraph(sentence_count: rand(4..18)), | ||
Faker::Lorem.paragraph(sentence_count: rand(4..18)) | ||
].join('<br><br>') | ||
end | ||
tag_list do | ||
[ | ||
%w[tdd rubocop], %w[seeds desafios], %w[boaspraticas solid], %w[vue zoom], %w[vue desafios], | ||
%w[codesaga desafios tdd], %w[rubocop vue seeds], %w[zoom boaspraticas solid], | ||
%w[tdd codesaga], %w[rubocop vue desafios], %w[seeds boaspraticas zoom], %w[solid codesaga] | ||
].sample | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters