ambition/spec/factories/missions.rb

43 lines
704 B
Ruby
Raw Normal View History

2016-12-26 10:19:56 +08:00
require 'faker'
FactoryGirl.define do
factory :mission do
2016-12-27 20:15:05 +08:00
sequence(:name){ |n| "Mission name #{n}" }
sequence(:content){ |n| "Mission #{n}" }
2016-12-26 10:19:56 +08:00
status "已完成"
2016-12-27 20:15:05 +08:00
priority 1
deadline "2016-10-17 10:00:00"
factory :no_content_mission do
content nil
end
factory :no_deadline_mission do
deadline nil
2016-12-26 10:19:56 +08:00
end
2016-12-27 20:15:05 +08:00
factory :no_status_mission do
status nil
end
factory :no_priority_mission do
priority nil
end
factory :priority_not_among_valid_values do
priority 5
end
factory :status_not_among_valid_values do
status "不存在"
2016-12-26 10:19:56 +08:00
end
2016-12-27 20:15:05 +08:00
2016-12-26 10:19:56 +08:00
end
end