Add :closed trait to note factory

This commit is contained in:
Anton Khorev 2024-01-05 12:34:27 +03:00
parent b154cefbf0
commit 6272b041c6
4 changed files with 23 additions and 14 deletions

View file

@ -4,6 +4,15 @@ FactoryBot.define do
longitude { 1 * GeoRecord::SCALE }
# tile { QuadTile.tile_for_point(1,1) }
trait :closed do
status { "closed" }
closed_at { Time.now.utc }
after(:create) do |note|
create(:note_comment, :body => "Closing comment", :event => "closed", :note => note)
end
end
factory :note_with_comments do
transient do
comments_count { 1 }