diff --git a/Gemfile.lock b/Gemfile.lock index 5d9184a24..943e88b05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -249,7 +249,7 @@ GEM minitest (5.22.3) mongo (2.19.3) bson (>= 4.14.1, < 5.0.0) - mongoid (8.1.4) + mongoid (8.1.5) activemodel (>= 5.1, < 7.2, != 7.0.0) concurrent-ruby (>= 1.0.5, < 2.0) mongo (>= 2.18.0, < 3.0.0) diff --git a/spec/models/travel_advice_edition_spec.rb b/spec/models/travel_advice_edition_spec.rb index bba7c55a0..562ae771a 100644 --- a/spec/models/travel_advice_edition_spec.rb +++ b/spec/models/travel_advice_edition_spec.rb @@ -571,9 +571,11 @@ context "parts" do it "should merge part validation errors with parent document's errors" do edition = create(:travel_advice_edition) - edition.parts.build(_id: "54c10d4d759b743528000010", order: "1", title: "", slug: "overview") - edition.parts.build(_id: "54c10d4d759b743528000011", order: "2", title: "Prepare for your appointment", slug: "") - edition.parts.build(_id: "54c10d4d759b743528000012", order: "3", title: "Valid", slug: "valid") + edition.parts = [ + Part.new(_id: "54c10d4d759b743528000010", order: "1", title: "", slug: "overview"), + Part.new(_id: "54c10d4d759b743528000011", order: "2", title: "Prepare for your appointment", slug: ""), + Part.new(_id: "54c10d4d759b743528000012", order: "3", title: "Valid", slug: "valid"), + ] expect(edition).not_to be_valid