2008-06-23 21:34:57 +02:00
|
|
|
class ProjectsScenario < Scenario::Base
|
|
|
|
|
def load
|
2008-06-23 12:56:47 +02:00
|
|
|
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
|
2008-06-23 21:34:57 +02:00
|
|
|
end
|
|
|
|
|
end
|