govuk_content_models 28.7.0 → 28.7.1

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 28.7.1
2
+
3
+ - Change the scheduled publishing timestamp to be London local time
4
+ instead of UTC.
1
5
  ## 28.7.0
2
6
 
3
7
  - Add `vehicle_recalls_and_faults_alert` artefact format
data/app/models/action.rb CHANGED
@@ -52,7 +52,7 @@ class Action
52
52
  def to_s
53
53
  if request_type == SCHEDULE_FOR_PUBLISHING
54
54
  string = "Scheduled for publishing"
55
- string += " on #{request_details['scheduled_time'].strftime('%d/%m/%Y %H:%M %Z')}" if request_details['scheduled_time'].present?
55
+ string += " on #{request_details['scheduled_time'].to_datetime.in_time_zone('London').strftime('%d/%m/%Y %H:%M')}" if request_details['scheduled_time'].present?
56
56
  string
57
57
  else
58
58
  request_type.humanize.capitalize
@@ -88,8 +88,6 @@ class Artefact
88
88
  "international_development_fund",
89
89
  "maib_report",
90
90
  "manual",
91
- "manual-change-history",
92
- "manual-section",
93
91
  "medical_safety_alert",
94
92
  "raib_report",
95
93
  "vehicle_recalls_and_faults_alert"],
@@ -8,7 +8,6 @@ class SlugValidator < ActiveModel::EachValidator
8
8
  FinderEmailSignupValidator,
9
9
  GovernmentPageValidator,
10
10
  ManualPageValidator,
11
- ManualChangeHistoryValidator,
12
11
  SpecialistDocumentPageValidator,
13
12
  BrowsePageValidator,
14
13
  DefaultValidator
@@ -119,7 +118,7 @@ protected
119
118
 
120
119
  class ManualPageValidator < InstanceValidator
121
120
  def applicable?
122
- of_kind?('manual') || of_kind?('manual-section')
121
+ of_kind?('manual')
123
122
  end
124
123
 
125
124
  def validate!
@@ -148,44 +147,6 @@ protected
148
147
  end
149
148
  end
150
149
 
151
- class ManualChangeHistoryValidator < InstanceValidator
152
- def applicable?
153
- of_kind?('manual-change-history')
154
- end
155
-
156
- def validate!
157
- validate_number_of_parts!
158
- validate_guidance_prefix!
159
- validate_updates_suffix!
160
- validate_parts_as_slugs!
161
- end
162
-
163
- private
164
- def validate_number_of_parts!
165
- unless url_parts.size == 3
166
- record.errors[attribute] << 'must contain three path parts'
167
- end
168
- end
169
-
170
- def validate_guidance_prefix!
171
- unless starts_with?('guidance/')
172
- record.errors[attribute] << 'must have a guidance/ prefix'
173
- end
174
- end
175
-
176
- def validate_updates_suffix!
177
- unless ends_with?('/updates')
178
- record.errors[attribute] << 'must have a /updates suffix'
179
- end
180
- end
181
-
182
- def validate_parts_as_slugs!
183
- unless url_parts.all? { |url_part| valid_slug?(url_part) }
184
- record.errors[attribute] << 'must be usable in a URL'
185
- end
186
- end
187
- end
188
-
189
150
  class SpecialistDocumentPageValidator < InstanceValidator
190
151
  def applicable?
191
152
  of_kind?(acceptable_formats)
@@ -208,8 +169,6 @@ protected
208
169
  def unacceptable_formats
209
170
  [
210
171
  "manual",
211
- "manual-change-history",
212
- "manual-section",
213
172
  ]
214
173
  end
215
174
  end
@@ -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 = "28.7.0"
3
+ VERSION = "28.7.1"
4
4
  end
@@ -6,7 +6,7 @@ class ActionTest < ActiveSupport::TestCase
6
6
  end
7
7
 
8
8
  test "#to_s should contain the scheduled time when request type is SCHEDULE_FOR_PUBLISHING" do
9
- assert_equal "Scheduled for publishing on 12/12/2014 00:00 UTC",
9
+ assert_equal "Scheduled for publishing on 12/12/2014 00:00",
10
10
  Action.new(:request_type => 'schedule_for_publishing',
11
11
  :request_details => { 'scheduled_time' => Date.parse('12/12/2014').to_time.utc }).to_s
12
12
  end
@@ -104,38 +104,6 @@ class SlugTest < ActiveSupport::TestCase
104
104
  end
105
105
  end
106
106
 
107
- context "Manual change history" do
108
- should "allow slugs of the form guidance/manual-slug/updates" do
109
- assert document_with_slug("guidance/a-manual/updates",
110
- kind: "manual-change-history").valid?
111
- end
112
-
113
- should "refuse slugs that don't start with guidance/" do
114
- refute document_with_slug("manuals/a-manual/updates",
115
- kind: "manual-change-history").valid?
116
- end
117
-
118
- should "refuse slugs that don't end with /updates" do
119
- refute document_with_slug("guidance/a-manual/change-history",
120
- kind: "manual-change-history").valid?
121
- end
122
-
123
- should "refuse slugs that don't have a manual-slug" do
124
- refute document_with_slug("guidance/change-history",
125
- kind: "manual-change-history").valid?
126
- end
127
-
128
- should "refuse slugs that have extra sections" do
129
- refute document_with_slug("guidance/a-manual/a-section/updates",
130
- kind: "manual-change-history").valid?
131
- end
132
-
133
- should "not allow invalid path segments" do
134
- refute document_with_slug("guidance/bad.manual.slug/updates",
135
- kind: "manual-change-history").valid?
136
- end
137
- end
138
-
139
107
  context "Manual pages" do
140
108
  should "allow slugs starting guidance/" do
141
109
  refute document_with_slug("manuals/a-manual", kind: "manual").valid?
@@ -145,8 +113,6 @@ class SlugTest < ActiveSupport::TestCase
145
113
  should "allow two or three path parts" do
146
114
  refute document_with_slug("guidance", kind: "manual").valid?
147
115
  assert document_with_slug("guidance/a-manual", kind: "manual").valid?
148
- assert document_with_slug("guidance/a-manual/a-section", kind: "manual-section").valid?
149
- refute document_with_slug("guidance/a-manual/a-section/a-subsection", kind: "manual-section").valid?
150
116
  end
151
117
 
152
118
  should "not allow invalid path segments" do
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.7.0
4
+ version: 28.7.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-05-06 00:00:00.000000000 Z
12
+ date: 2015-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bson_ext
@@ -356,7 +356,6 @@ files:
356
356
  - app/models/local_interaction.rb
357
357
  - app/models/local_service.rb
358
358
  - app/models/local_transaction_edition.rb
359
- - app/models/manual_change_history.rb
360
359
  - app/models/overview_dashboard.rb
361
360
  - app/models/part.rb
362
361
  - app/models/parted.rb
@@ -440,7 +439,6 @@ files:
440
439
  - test/models/local_authority_test.rb
441
440
  - test/models/local_service_test.rb
442
441
  - test/models/local_transaction_edition_test.rb
443
- - test/models/manual_change_history_test.rb
444
442
  - test/models/overview_dashboard_test.rb
445
443
  - test/models/parted_test.rb
446
444
  - test/models/prerendered_entity_tests.rb
@@ -480,7 +478,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
480
478
  version: '0'
481
479
  segments:
482
480
  - 0
483
- hash: -4538163114857948061
481
+ hash: -1030593290210728004
484
482
  required_rubygems_version: !ruby/object:Gem::Requirement
485
483
  none: false
486
484
  requirements:
@@ -489,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
489
487
  version: '0'
490
488
  segments:
491
489
  - 0
492
- hash: -4538163114857948061
490
+ hash: -1030593290210728004
493
491
  requirements: []
494
492
  rubyforge_project:
495
493
  rubygems_version: 1.8.23
@@ -524,7 +522,6 @@ test_files:
524
522
  - test/models/local_authority_test.rb
525
523
  - test/models/local_service_test.rb
526
524
  - test/models/local_transaction_edition_test.rb
527
- - test/models/manual_change_history_test.rb
528
525
  - test/models/overview_dashboard_test.rb
529
526
  - test/models/parted_test.rb
530
527
  - test/models/prerendered_entity_tests.rb
@@ -1,15 +0,0 @@
1
- require "prerendered_entity"
2
-
3
- class ManualChangeHistory
4
- include Mongoid::Document
5
- include Mongoid::Timestamps
6
- extend PrerenderedEntity
7
-
8
- field :updates, type: Array
9
- field :slug, type: String
10
- field :manual_slug, type: String
11
-
12
- index "slug", unique: true
13
-
14
- validates :slug, uniqueness: true
15
- end
@@ -1,10 +0,0 @@
1
- require "test_helper"
2
- require "models/prerendered_entity_tests"
3
-
4
- class ManualChangeHistoryTest < ActiveSupport::TestCase
5
- include PrerenderedEntityTests
6
-
7
- def model_class
8
- ManualChangeHistory
9
- end
10
- end