mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 15:43:14 +01:00
Move factories to spec dir and add helper module
This commit is contained in:
parent
e351f12b3f
commit
d9f95f9e97
2 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
require_relative '../factory_helper'
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :paper do
|
||||
name { Faker::Lorem.sentence }
|
||||
|
@ -6,7 +8,7 @@ FactoryGirl.define do
|
|||
body "leipzig"
|
||||
published_at "2015-07-20 21:16:53"
|
||||
scraped_at "2015-07-20 21:16:53"
|
||||
paper_type "Verwaltungsstandpunkt"
|
||||
paper_type { FactoryHelper.paper_type }
|
||||
originator { Faker::Name.name }
|
||||
resolution { Faker::Lorem.paragraph(3) }
|
||||
content "-------------------------------\n\n " # oh well...
|
23
spec/factory_helper.rb
Normal file
23
spec/factory_helper.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
module FactoryHelper
|
||||
|
||||
PAPER_TYPES = [
|
||||
"Verwaltungsstandpunkt",
|
||||
"Anfrage",
|
||||
"Beschlussvorlage",
|
||||
"Änderungsantrag",
|
||||
"Antrag",
|
||||
"Neufassung",
|
||||
"Informationsvorlage",
|
||||
"Einwohneranfrage",
|
||||
"Petition",
|
||||
"schriftliche Antwort zur Anfrage",
|
||||
"Wichtige Angelegenheit",
|
||||
"Eilentscheidung",
|
||||
"Dringliche Anfrage"
|
||||
]
|
||||
|
||||
def self.paper_type
|
||||
PAPER_TYPES.sample
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue