diff --git a/spec/factories/papers.rb b/spec/factories/papers.rb index 8db1d15..0c3239e 100644 --- a/spec/factories/papers.rb +++ b/spec/factories/papers.rb @@ -4,7 +4,7 @@ FactoryGirl.define do factory :paper do name { Faker::Lorem.sentence } url { Faker::Internet.url("ris.example.org") } - reference "MyString" + sequence(:reference) { |n| FactoryHelper.reference(n) } body "leipzig" published_at "2015-07-20 21:16:53" scraped_at "2015-07-20 21:16:53" diff --git a/spec/factory_helper.rb b/spec/factory_helper.rb index 7e0adc5..95f08db 100644 --- a/spec/factory_helper.rb +++ b/spec/factory_helper.rb @@ -20,4 +20,10 @@ module FactoryHelper PAPER_TYPES.sample end + REFERENCE = "A-%05i/16" + + def self.reference(seq) + REFERENCE % seq + end + end