From 80a67d094deba937b2d74d1a600bda705a17fa1a Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Wed, 24 Feb 2016 11:59:37 +0100 Subject: [PATCH] Make url unique in paper factory --- spec/factories/papers.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/factories/papers.rb b/spec/factories/papers.rb index 0c3239e..43051de 100644 --- a/spec/factories/papers.rb +++ b/spec/factories/papers.rb @@ -2,15 +2,15 @@ require_relative '../factory_helper' FactoryGirl.define do factory :paper do - name { Faker::Lorem.sentence } - url { Faker::Internet.url("ris.example.org") } + name { Faker::Lorem.sentence } + sequence(:url) { |n| Faker::Internet.url("ris.example.org", "/paper-#{n}.html") } sequence(:reference) { |n| FactoryHelper.reference(n) } - body "leipzig" - published_at "2015-07-20 21:16:53" - scraped_at "2015-07-20 21:16:53" - paper_type { FactoryHelper.paper_type } - originator { Faker::Name.name } - resolution { Faker::Lorem.paragraph(3) } - content "-------------------------------\n\n " # oh well... + body "leipzig" + published_at "2015-07-20 21:16:53" + scraped_at "2015-07-20 21:16:53" + paper_type { FactoryHelper.paper_type } + originator { Faker::Name.name } + resolution { Faker::Lorem.paragraph(3) } + content "-------------------------------\n\n " # oh well... end end