OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/spec/factories/project_factory.rb

27 lines
700 B

FactoryGirl.define do
factory :project do
sequence(:name) { |n| "My Project No. #{n}" }
sequence(:identifier) { |n| "myproject_no_#{n}" }
enabled_module_names Redmine::AccessControl.available_project_modules
factory :public_project do
is_public true
end
factory :project_with_trackers do
after :build do |project|
project.trackers << FactoryGirl.build(:tracker)
end
after :create do |project|
project.trackers.each { |tracker| tracker.save! }
end
factory :valid_project do
after :build do |project|
project.trackers << FactoryGirl.build(:tracker_with_workflow)
end
end
end
end
end