зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-07 20:15:51 +03:00
test: Improve test suite setup
Этот коммит содержится в:
@@ -7,7 +7,8 @@ end
|
||||
(11..20).each do |i|
|
||||
age = 21 + 3 * (i - 10)
|
||||
attrs = { name: "Author #{i}", age: age, email: "some@email#{i}.com" }
|
||||
Author.find_or_create_by!(attrs) do |author|
|
||||
Author.find_or_create_by!(name: "Author #{i}") do |author|
|
||||
author.assign_attributes(attrs)
|
||||
author.profile = Profile.new(description: "Profile description for Author #{i}") if (i % 3).zero?
|
||||
end
|
||||
end
|
||||
@@ -19,6 +20,8 @@ tags = Tag.where.not(name: 'A test tag').pluck(:id)
|
||||
title: "Post #{i}",
|
||||
author_id: authors.sample,
|
||||
position: rand(100),
|
||||
summary: "<p><em>Summary</em> for post #{i}</p>",
|
||||
description: "<p><strong>Some bold</strong> <em>Some italic</em> <u>Some underline</u> [#{i}]</p>",
|
||||
created_at: Time.now - rand(3600).seconds
|
||||
}
|
||||
attrs[:category] = 'news' if (i % 4).zero?
|
||||
|
||||
Ссылка в новой задаче
Block a user