govuk_content_models 30.0.0 → 31.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/models/edition.rb +1 -2
- data/lib/govuk_content_models/version.rb +1 -1
- data/test/models/artefact_test.rb +2 -2
- data/test/models/edition_test.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f180214b4c41e4eeeca68831ad6ba2ca55f1ef7f
|
4
|
+
data.tar.gz: c3620788cedec2c668987ae8d8b563e527e080e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf06907c1430d183ac52ae67cc858f67d68cab01f6963a406683fbcd8738c15595016aed443495e3310b0068f4eaea003214a4a2bfc48fc94950c7f0398eb54
|
7
|
+
data.tar.gz: 4b276c0907a6b77a0f0201c7e2e27d4e4c852a3e611f09f46d07e284a8f294270caab42e98745a54dd06159cc2ffc2d96b653f914cd926fc4136a9c37aa64349
|
data/CHANGELOG.md
CHANGED
data/app/models/edition.rb
CHANGED
@@ -224,8 +224,7 @@ class Edition
|
|
224
224
|
new_edition
|
225
225
|
end
|
226
226
|
|
227
|
-
def self.find_or_create_from_panopticon_data(panopticon_id,
|
228
|
-
importing_user, api_credentials)
|
227
|
+
def self.find_or_create_from_panopticon_data(panopticon_id, importing_user)
|
229
228
|
existing_publication = Edition.where(panopticon_id: panopticon_id)
|
230
229
|
.order_by([:version_number, :desc]).first
|
231
230
|
return existing_publication if existing_publication
|
@@ -393,7 +393,7 @@ class ArtefactTest < ActiveSupport::TestCase
|
|
393
393
|
)
|
394
394
|
|
395
395
|
user1 = FactoryGirl.create(:user)
|
396
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(artefact.id, user1
|
396
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(artefact.id, user1)
|
397
397
|
edition.state = "published"
|
398
398
|
edition.save!
|
399
399
|
|
@@ -414,7 +414,7 @@ class ArtefactTest < ActiveSupport::TestCase
|
|
414
414
|
owning_app: "publisher",
|
415
415
|
)
|
416
416
|
user1 = FactoryGirl.create(:user)
|
417
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(artefact.id, user1
|
417
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(artefact.id, user1)
|
418
418
|
|
419
419
|
refute artefact.any_editions_published?
|
420
420
|
|
data/test/models/edition_test.rb
CHANGED
@@ -451,7 +451,7 @@ class EditionTest < ActiveSupport::TestCase
|
|
451
451
|
a = Artefact.find(artefact.id)
|
452
452
|
user = User.create
|
453
453
|
|
454
|
-
publication = Edition.find_or_create_from_panopticon_data(artefact.id, user
|
454
|
+
publication = Edition.find_or_create_from_panopticon_data(artefact.id, user)
|
455
455
|
|
456
456
|
assert_kind_of AnswerEdition, publication
|
457
457
|
assert_equal artefact.name, publication.title
|
@@ -530,7 +530,7 @@ class EditionTest < ActiveSupport::TestCase
|
|
530
530
|
|
531
531
|
test "deleting a newer draft of a published edition removes sibling information" do
|
532
532
|
user1 = FactoryGirl.create(:user)
|
533
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1
|
533
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1)
|
534
534
|
edition.update_attribute(:state, "published")
|
535
535
|
second_edition = edition.build_clone
|
536
536
|
second_edition.save!
|
@@ -546,7 +546,7 @@ class EditionTest < ActiveSupport::TestCase
|
|
546
546
|
|
547
547
|
test "the latest edition should remove sibling_in_progress details if it is present" do
|
548
548
|
user1 = FactoryGirl.create(:user)
|
549
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1
|
549
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1)
|
550
550
|
edition.update_attribute(:state, "published")
|
551
551
|
|
552
552
|
# simulate a document having a newer edition destroyed (previous behaviour).
|
@@ -561,7 +561,7 @@ class EditionTest < ActiveSupport::TestCase
|
|
561
561
|
FactoryGirl.create(:live_tag, tag_id: "test-section", title: "Test section", tag_type: "section")
|
562
562
|
|
563
563
|
user1 = FactoryGirl.create(:user)
|
564
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1
|
564
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1)
|
565
565
|
|
566
566
|
assert_difference "Artefact.count", -1 do
|
567
567
|
edition.destroy
|
@@ -572,7 +572,7 @@ class EditionTest < ActiveSupport::TestCase
|
|
572
572
|
|
573
573
|
FactoryGirl.create(:live_tag, tag_id: "test-section", title: "Test section", tag_type: "section")
|
574
574
|
user1 = FactoryGirl.create(:user)
|
575
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1
|
575
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(@artefact.id, user1)
|
576
576
|
edition.update_attribute(:state, "published")
|
577
577
|
|
578
578
|
edition.reload
|
@@ -905,7 +905,7 @@ class EditionTest < ActiveSupport::TestCase
|
|
905
905
|
owning_app: "publisher",
|
906
906
|
)
|
907
907
|
|
908
|
-
edition = AnswerEdition.find_or_create_from_panopticon_data(artefact.id, user
|
908
|
+
edition = AnswerEdition.find_or_create_from_panopticon_data(artefact.id, user)
|
909
909
|
|
910
910
|
assert_equal user.name, edition.creator
|
911
911
|
end
|