diff --git a/test/factories/papers.rb b/spec/factories/papers.rb similarity index 84% rename from test/factories/papers.rb rename to spec/factories/papers.rb index 6b20df9..8db1d15 100644 --- a/test/factories/papers.rb +++ b/spec/factories/papers.rb @@ -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... diff --git a/spec/factory_helper.rb b/spec/factory_helper.rb new file mode 100644 index 0000000..7e0adc5 --- /dev/null +++ b/spec/factory_helper.rb @@ -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