govuk_content_models 7.1.1 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,11 +26,47 @@ FactoryGirl.define do
26
26
  sequence(:slug) { |n| "slug-#{n}" }
27
27
  kind Artefact::FORMATS.first
28
28
  owning_app 'publisher'
29
- end
30
29
 
31
- factory :non_publisher_artefact, parent: :artefact do
32
- kind 'smart-answer'
33
- owning_app 'smart-answers'
30
+ trait :whitehall do
31
+ sequence(:slug) {|n| "government/slug--#{n}"}
32
+ owning_app "whitehall"
33
+ kind Artefact::FORMATS_BY_DEFAULT_OWNING_APP["whitehall"].first
34
+ end
35
+
36
+ trait :with_published_edition do
37
+ after(:create) {|object|
38
+ self.create("#{object.kind}_edition".to_sym, panopticon_id: object.id, slug: object.slug, state: "published")
39
+ }
40
+ end
41
+
42
+ trait :non_publisher do
43
+ kind 'smart-answer'
44
+ owning_app 'smart-answers'
45
+ end
46
+
47
+ trait :draft do
48
+ state "draft"
49
+ end
50
+
51
+ trait :live do
52
+ state "live"
53
+ end
54
+
55
+ trait :archived do
56
+ state "archived"
57
+ end
58
+
59
+ factory :draft_artefact, traits: [:draft]
60
+ factory :live_artefact, traits: [:live]
61
+ factory :archived_artefact, traits: [:archived]
62
+
63
+ factory :live_artefact_with_edition, traits: [:live, :with_published_edition]
64
+
65
+ factory :whitehall_draft_artefact, traits: [:whitehall, :draft]
66
+ factory :whitehall_live_artefact, traits: [:whitehall, :live]
67
+ factory :whitehall_archived_artefact, traits: [:whitehall, :archived]
68
+
69
+ factory :non_publisher_artefact, traits: [:non_publisher]
34
70
  end
35
71
 
36
72
  factory :edition, class: AnswerEdition do
@@ -1,4 +1,4 @@
1
1
  module GovukContentModels
2
2
  # Changing this causes Jenkins to tag and release the gem into the wild
3
- VERSION = "7.1.1"
3
+ VERSION = "7.2.0"
4
4
  end
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: 7.1.1
4
+ version: 7.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -456,7 +456,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
456
456
  version: '0'
457
457
  segments:
458
458
  - 0
459
- hash: -3334293540953649833
459
+ hash: -3093764409837900462
460
460
  required_rubygems_version: !ruby/object:Gem::Requirement
461
461
  none: false
462
462
  requirements:
@@ -465,7 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
465
465
  version: '0'
466
466
  segments:
467
467
  - 0
468
- hash: -3334293540953649833
468
+ hash: -3093764409837900462
469
469
  requirements: []
470
470
  rubyforge_project:
471
471
  rubygems_version: 1.8.23