]> git.openstreetmap.org Git - rails.git/blob - test/factories/changesets.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / factories / changesets.rb
1 # frozen_string_literal: true
2
3 FactoryBot.define do
4   factory :changeset do
5     transient do
6       bbox { nil }
7     end
8
9     created_at { Time.now.utc }
10     closed_at { Time.now.utc + 1.day }
11     min_lon { (bbox[0] * GeoRecord::SCALE).round if bbox }
12     min_lat { (bbox[1] * GeoRecord::SCALE).round if bbox }
13     max_lon { (bbox[2] * GeoRecord::SCALE).round if bbox }
14     max_lat { (bbox[3] * GeoRecord::SCALE).round if bbox }
15
16     user
17
18     trait :closed do
19       created_at { Time.now.utc - 5.hours }
20       closed_at { Time.now.utc - 4.hours }
21     end
22   end
23 end