rewriting some factories

This commit is contained in:
2019-01-13 10:01:22 +01:00
parent fea219ba92
commit 71d14c83ae
7 changed files with 46 additions and 6 deletions

View File

@@ -1,7 +1,24 @@
FactoryGirl.define do
sequence (:title) {|n| "Wichtige Neuigkeit #{n}"}
sequence (:text) {|n| "Wichtiger text #{n}"}
factory :neuigkeit do
title "WIChtige Neuigkeit"
text "<p> Das ist eine wichtige Information </p>"
title
text
datum 1.days.ago
association :author, factory: :user
trait :with_rubrik do
association :rubrik, factory: :rubrik, public: true
end
trait :with_intern_rubrik do
association :rubrik, factory: :rubrik, public: false, name: "InterneRubrik"
end
trait :with_meeting do
association :meeting, factory: :meeting
end
trait :unpublished do
datum nil
end
end
end