govuk_content_models 11.0.0 → 11.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/app/models/workflow.rb +1 -0
- data/lib/govuk_content_models/version.rb +1 -1
- data/test/models/edition_test.rb +28 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/app/models/workflow.rb
CHANGED
data/test/models/edition_test.rb
CHANGED
@@ -473,6 +473,34 @@ class EditionTest < ActiveSupport::TestCase
|
|
473
473
|
assert_nil loaded_answer
|
474
474
|
end
|
475
475
|
|
476
|
+
test "deleting a newer draft of a published edition removes sibling information" do
|
477
|
+
user1 = FactoryGirl.create(:user)
|
478
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1, {})
|
479
|
+
edition.update_attribute(:state, "published")
|
480
|
+
second_edition = edition.build_clone
|
481
|
+
second_edition.save!
|
482
|
+
edition.reload
|
483
|
+
|
484
|
+
assert edition.sibling_in_progress
|
485
|
+
|
486
|
+
second_edition.destroy
|
487
|
+
edition.reload
|
488
|
+
|
489
|
+
assert_nil edition.sibling_in_progress
|
490
|
+
end
|
491
|
+
|
492
|
+
test "the latest edition should remove sibling_in_progress details if it is present" do
|
493
|
+
user1 = FactoryGirl.create(:user)
|
494
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1, {})
|
495
|
+
edition.update_attribute(:state, "published")
|
496
|
+
|
497
|
+
# simulate a document having a newer edition destroyed (previous behaviour).
|
498
|
+
edition.sibling_in_progress = 2
|
499
|
+
edition.save(validate: false)
|
500
|
+
|
501
|
+
assert edition.can_create_new_edition?
|
502
|
+
end
|
503
|
+
|
476
504
|
test "should also delete associated artefact" do
|
477
505
|
|
478
506
|
FactoryGirl.create(:tag, tag_id: "test-section", title: "Test section", tag_type: "section")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_content_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.0.
|
4
|
+
version: 11.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson_ext
|
@@ -463,7 +463,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
463
463
|
version: '0'
|
464
464
|
segments:
|
465
465
|
- 0
|
466
|
-
hash: -
|
466
|
+
hash: -1368179395246728508
|
467
467
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
468
468
|
none: false
|
469
469
|
requirements:
|
@@ -472,7 +472,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
472
472
|
version: '0'
|
473
473
|
segments:
|
474
474
|
- 0
|
475
|
-
hash: -
|
475
|
+
hash: -1368179395246728508
|
476
476
|
requirements: []
|
477
477
|
rubyforge_project:
|
478
478
|
rubygems_version: 1.8.23
|