govuk_content_models 26.0.0 → 26.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/app/models/edition.rb +1 -0
- data/app/models/workflow.rb +8 -0
- data/lib/govuk_content_models/version.rb +1 -1
- data/test/models/workflow_test.rb +2 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/app/models/edition.rb
CHANGED
data/app/models/workflow.rb
CHANGED
@@ -32,6 +32,10 @@ module Workflow
|
|
32
32
|
edition.was_published
|
33
33
|
end
|
34
34
|
|
35
|
+
before_transition on: :request_review do |edition, transition|
|
36
|
+
edition.review_requested_at = Time.zone.now
|
37
|
+
end
|
38
|
+
|
35
39
|
event :request_review do
|
36
40
|
transition [:draft, :amends_needed] => :in_review
|
37
41
|
end
|
@@ -86,6 +90,10 @@ module Workflow
|
|
86
90
|
transition all => :archived, :unless => :archived?
|
87
91
|
end
|
88
92
|
|
93
|
+
state :in_review do
|
94
|
+
validates_presence_of :review_requested_at
|
95
|
+
end
|
96
|
+
|
89
97
|
state :scheduled_for_publishing do
|
90
98
|
validates_presence_of :publish_at
|
91
99
|
validate :publish_at_is_in_the_future
|
@@ -112,8 +112,10 @@ class WorkflowTest < ActiveSupport::TestCase
|
|
112
112
|
guide = template_guide
|
113
113
|
user = User.create(name:"Ben")
|
114
114
|
refute guide.in_review?
|
115
|
+
refute guide.review_requested_at
|
115
116
|
request_review(user, guide)
|
116
117
|
assert guide.in_review?
|
118
|
+
assert_in_delta Time.zone.now.to_f, guide.review_requested_at.to_f, 1.0
|
117
119
|
end
|
118
120
|
|
119
121
|
test "guide workflow" 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: 26.
|
4
|
+
version: 26.1.0
|
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-12-
|
12
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson_ext
|
@@ -474,7 +474,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
474
474
|
version: '0'
|
475
475
|
segments:
|
476
476
|
- 0
|
477
|
-
hash:
|
477
|
+
hash: 3310978517269698520
|
478
478
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
479
479
|
none: false
|
480
480
|
requirements:
|
@@ -483,7 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
483
483
|
version: '0'
|
484
484
|
segments:
|
485
485
|
- 0
|
486
|
-
hash:
|
486
|
+
hash: 3310978517269698520
|
487
487
|
requirements: []
|
488
488
|
rubyforge_project:
|
489
489
|
rubygems_version: 1.8.23
|