From 98ec26e46f6bfe627621f4ec8d7693389803c737 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2019 15:56:07 +0000 Subject: [PATCH 1/2] Bump faker from 1.9.6 to 2.1.0 Bumps [faker](https://github.com/stympy/faker) from 1.9.6 to 2.1.0. - [Release notes](https://github.com/stympy/faker/releases) - [Changelog](https://github.com/stympy/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/stympy/faker/compare/1.9.6...v2.1.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 96b969ee3..0855b2794 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,7 +88,7 @@ GEM unf (>= 0.0.5, < 1.0.0) erubi (1.8.0) execjs (2.7.0) - faker (1.9.6) + faker (2.1.0) i18n (>= 0.7) faraday (0.15.4) multipart-post (>= 1.2, < 3) From edfb19e407f0419fd2fd10204962ca18ad310531 Mon Sep 17 00:00:00 2001 From: Alan Gabbianelli Date: Tue, 6 Aug 2019 17:19:32 +0100 Subject: [PATCH 2/2] Fix Faker syntax Version 2 of Faker has several breaking changes. One that affects us is this: `Faker::Lorem.characters(char_count = nil)` becomes `Faker::Lorem.characters(number: nil)` --- test/integration/document_collection_test.rb | 2 +- .../topical_event_about_page_test.rb | 4 ++-- .../content_item/contents_list_test.rb | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/integration/document_collection_test.rb b/test/integration/document_collection_test.rb index ae5a257e5..0f67e1a94 100644 --- a/test/integration/document_collection_test.rb +++ b/test/integration/document_collection_test.rb @@ -10,7 +10,7 @@ class DocumentCollectionTest < ActionDispatch::IntegrationTest test "document collection with no body and 2 collection groups where 1st group has long body" do content_item = get_content_example('document_collection') - content_item['details']['collection_groups'][0]['body'] = Faker::Lorem.characters(416) + content_item['details']['collection_groups'][0]['body'] = Faker::Lorem.characters(number: 416) content_store_has_item(content_item['base_path'], content_item.to_json) visit(content_item['base_path']) diff --git a/test/integration/topical_event_about_page_test.rb b/test/integration/topical_event_about_page_test.rb index 9640c7dda..3c3c408e9 100644 --- a/test/integration/topical_event_about_page_test.rb +++ b/test/integration/topical_event_about_page_test.rb @@ -50,8 +50,8 @@ def topical_event_end_date def long_first_item_body "

Item 1

-

#{Faker::Lorem.characters(200)}

-

#{Faker::Lorem.characters(216)}

+

#{Faker::Lorem.characters(number: 200)}

+

#{Faker::Lorem.characters(number: 216)}

Item 2

#{Faker::Lorem.sentence}

" end diff --git a/test/presenters/content_item/contents_list_test.rb b/test/presenters/content_item/contents_list_test.rb index 5068e9539..7c06e62c9 100644 --- a/test/presenters/content_item/contents_list_test.rb +++ b/test/presenters/content_item/contents_list_test.rb @@ -83,8 +83,8 @@ def body class << @contents_list def body "

One

-

#{Faker::Lorem.characters(220)}

-

#{Faker::Lorem.characters(196)}

+

#{Faker::Lorem.characters(number: 220)}

+

#{Faker::Lorem.characters(number: 196)}

Two

#{Faker::Lorem.sentence}

" end @@ -96,13 +96,13 @@ def body class << @contents_list def body "

One

-

#{Faker::Lorem.characters(40)}

+

#{Faker::Lorem.characters(number: 40)}

-

#{Faker::Lorem.characters(40)}

+

#{Faker::Lorem.characters(number: 40)}

Two

#{Faker::Lorem.sentence}

" end @@ -129,8 +129,8 @@ def body class << @contents_list def body "

One

-

#{Faker::Lorem.characters(10)}

-

#{Faker::Lorem.characters(10)}

+

#{Faker::Lorem.characters(number: 10)}

+

#{Faker::Lorem.characters(number: 10)}

Two

#{Faker::Lorem.sentence}

" end @@ -168,7 +168,7 @@ class << @contents_list def body "

One

-

#{Faker::Lorem.characters(225)}

+

#{Faker::Lorem.characters(number: 225)}

Two

#{Faker::Lorem.sentence}

" end @@ -193,7 +193,7 @@ def body test "#show_contents_list? returns true if body is over 415 characters and has no h2s present" do class << @contents_list def body - "

#{Faker::Lorem.characters(416)}

" + "

#{Faker::Lorem.characters(number: 416)}

" end end @contents_list.stubs(:contents_items).returns(["item 1", "item2"])