Make url unique in paper factory

This commit is contained in:
Lars Henrik Mai 2016-02-24 11:59:37 +01:00
parent 9ae58e3a8d
commit 80a67d094d

View file

@ -2,15 +2,15 @@ require_relative '../factory_helper'
FactoryGirl.define do FactoryGirl.define do
factory :paper do factory :paper do
name { Faker::Lorem.sentence } name { Faker::Lorem.sentence }
url { Faker::Internet.url("ris.example.org") } sequence(:url) { |n| Faker::Internet.url("ris.example.org", "/paper-#{n}.html") }
sequence(:reference) { |n| FactoryHelper.reference(n) } sequence(:reference) { |n| FactoryHelper.reference(n) }
body "leipzig" body "leipzig"
published_at "2015-07-20 21:16:53" published_at "2015-07-20 21:16:53"
scraped_at "2015-07-20 21:16:53" scraped_at "2015-07-20 21:16:53"
paper_type { FactoryHelper.paper_type } paper_type { FactoryHelper.paper_type }
originator { Faker::Name.name } originator { Faker::Name.name }
resolution { Faker::Lorem.paragraph(3) } resolution { Faker::Lorem.paragraph(3) }
content "-------------------------------\n\n " # oh well... content "-------------------------------\n\n " # oh well...
end end
end end