mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-20 17:20:12 +01:00
20 lines
638 B
Ruby
20 lines
638 B
Ruby
class ProjectsScenario < Scenario::Base
|
|
def load
|
|
create_project :build_time_machine, 'Build a working time machine'
|
|
create_project :make_more_money, 'Make more money than Billy Gates'
|
|
create_project :evict_dinosaurs, 'Evict dinosaurs from the garden'
|
|
create_project :attend_railsconf, 'Attend RailsConf'
|
|
end
|
|
|
|
def create_project(identifier, name)
|
|
attributes = {
|
|
:name => name,
|
|
:state => 'active',
|
|
:created_at => 4.day.ago,
|
|
:updated_at => 1.minute.ago
|
|
}
|
|
create_model :project,
|
|
identifier || attributes[:name].split.first.downcase.to_sym,
|
|
attributes
|
|
end
|
|
end
|