Fix deprecated Faker usage in paper factory

This commit is contained in:
Lars Henrik Mai 2020-03-09 11:14:42 +01:00
parent e33931c47c
commit 75f6467237
3 changed files with 23 additions and 2 deletions

View file

@ -65,6 +65,7 @@ group :test do
gem "factory_bot_rails"
gem 'shoulda-matchers', '~> 3.1'
gem 'faker'
gem 'rubocop-faker'
gem 'simplecov', require: false
gem 'database_cleaner'
gem 'coveralls', require: false

View file

@ -44,6 +44,7 @@ GEM
capybara (~> 3.13, < 4)
websocket-driver (>= 0.6.5)
arel (8.0.0)
ast (2.4.0)
awesome_print (1.8.0)
builder (3.2.4)
capybara (3.31.0)
@ -107,6 +108,7 @@ GEM
hashie (3.6.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
@ -155,6 +157,9 @@ GEM
faraday
multi_json
omniauth (~> 1.0)
parallel (1.19.1)
parser (2.7.0.4)
ast (~> 2.4.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
@ -196,11 +201,13 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
rdoc (4.3.0)
regexp_parser (1.7.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rexml (3.2.4)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
@ -218,6 +225,17 @@ GEM
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rubocop (0.80.1)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-faker (0.2.0)
rubocop (>= 0.74)
ruby-progressbar (1.10.1)
sass (3.4.25)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
@ -270,6 +288,7 @@ GEM
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.1)
validate_url (1.0.8)
activemodel (>= 3.0.0)
public_suffix
@ -310,6 +329,7 @@ DEPENDENCIES
rails-controller-testing
rails-i18n
rspec-rails (~> 3.0)
rubocop-faker
sass-rails
sdoc (~> 0.4.0)
shoulda-matchers (~> 3.1)

View file

@ -3,14 +3,14 @@ require_relative '../factory_helper'
FactoryBot.define do
factory :paper do
name { Faker::Lorem.sentence }
sequence(:url) { |n| Faker::Internet.url("ris.example.org", "/paper-#{n}.html") }
sequence(:url) { |n| Faker::Internet.url(host: "ris.example.org", path: "/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) }
resolution { Faker::Lorem.paragraph(sentence_count: 3) }
content { "-------------------------------\n\n " }
end
end