From ebc371a1826277fbb31796bffbcfd680dc847ea4 Mon Sep 17 00:00:00 2001 From: cblanc Date: Sat, 9 May 2015 16:21:18 +0100 Subject: [PATCH] Added necessary factory methods to test shoutbox --- spec/factories/category.rb | 8 ++++++++ spec/factories/gather.rb | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 spec/factories/gather.rb diff --git a/spec/factories/category.rb b/spec/factories/category.rb index 5578a38..14dd5ef 100644 --- a/spec/factories/category.rb +++ b/spec/factories/category.rb @@ -3,4 +3,12 @@ FactoryGirl.define do sequence(:name) { |n| "Category #{n}" } sequence(:sort) { |n| n } end + + trait :news do + domain Category::DOMAIN_NEWS + end + + trait :game do + domain Category::DOMAIN_GAMES + end end \ No newline at end of file diff --git a/spec/factories/gather.rb b/spec/factories/gather.rb new file mode 100644 index 0000000..a7b1d0a --- /dev/null +++ b/spec/factories/gather.rb @@ -0,0 +1,13 @@ +FactoryGirl.define do + factory :gather do + association :category, factory: [:category, :game] + end + + trait :running do + status Gather::STATE_RUNNING + end + + trait :picking do + status Gather::STATE_PICKING + end +end