govuk_content_models 28.6.0 → 28.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/app/models/edition.rb +4 -0
- data/lib/govuk_content_models/version.rb +1 -1
- data/test/models/edition_test.rb +21 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/app/models/edition.rb
CHANGED
@@ -210,6 +210,10 @@ class Edition
|
|
210
210
|
new_edition.body = whole_body
|
211
211
|
end
|
212
212
|
|
213
|
+
if edition_class == SimpleSmartAnswerEdition && %w(AnswerEdition GuideEdition ProgrammeEdition TransactionEdition).include?(self.class.name)
|
214
|
+
new_edition.body = whole_body
|
215
|
+
end
|
216
|
+
|
213
217
|
if edition_class == TransactionEdition and %w(AnswerEdition GuideEdition ProgrammeEdition).include?(self.class.name)
|
214
218
|
new_edition.more_information = whole_body
|
215
219
|
end
|
data/test/models/edition_test.rb
CHANGED
@@ -285,6 +285,27 @@ class EditionTest < ActiveSupport::TestCase
|
|
285
285
|
assert_equal new_edition.more_information, "Test body"
|
286
286
|
end
|
287
287
|
|
288
|
+
test "Cloning from AnswerEdition into SimpleSmartAnswerEdition" do
|
289
|
+
edition = FactoryGirl.create(
|
290
|
+
:answer_edition,
|
291
|
+
state: "published",
|
292
|
+
panopticon_id: @artefact.id,
|
293
|
+
version_number: 1,
|
294
|
+
department: "Test dept",
|
295
|
+
overview: "I am a test overview",
|
296
|
+
body: "Test body"
|
297
|
+
)
|
298
|
+
new_edition = edition.build_clone SimpleSmartAnswerEdition
|
299
|
+
|
300
|
+
assert_equal new_edition.class, SimpleSmartAnswerEdition
|
301
|
+
assert_equal new_edition.version_number, 2
|
302
|
+
assert_equal new_edition.panopticon_id, @artefact.id.to_s
|
303
|
+
assert_equal new_edition.state, "draft"
|
304
|
+
assert_equal new_edition.department, "Test dept"
|
305
|
+
assert_equal new_edition.overview, "I am a test overview"
|
306
|
+
assert_equal new_edition.body, "Test body"
|
307
|
+
end
|
308
|
+
|
288
309
|
test "Cloning from GuideEdition into TransactionEdition" do
|
289
310
|
edition = FactoryGirl.create(
|
290
311
|
:guide_edition,
|
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: 28.6.
|
4
|
+
version: 28.6.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: 2015-
|
12
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson_ext
|
@@ -480,7 +480,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
480
480
|
version: '0'
|
481
481
|
segments:
|
482
482
|
- 0
|
483
|
-
hash: -
|
483
|
+
hash: -2209336086110100921
|
484
484
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
485
485
|
none: false
|
486
486
|
requirements:
|
@@ -489,7 +489,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
489
489
|
version: '0'
|
490
490
|
segments:
|
491
491
|
- 0
|
492
|
-
hash: -
|
492
|
+
hash: -2209336086110100921
|
493
493
|
requirements: []
|
494
494
|
rubyforge_project:
|
495
495
|
rubygems_version: 1.8.23
|