govuk_content_models 14.1.0 → 14.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/app/models/workflow_actor.rb +1 -1
- data/lib/govuk_content_models/version.rb +1 -1
- data/test/models/workflow_actor_test.rb +17 -6
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -98,7 +98,7 @@ module WorkflowActor
|
|
98
98
|
# advance state if possible (i.e. if in "fact_check" state),
|
99
99
|
# save separately without validation
|
100
100
|
# http://rubydoc.info/github/pluginaweek/state_machine/StateMachine/Machine:event
|
101
|
-
edition.
|
101
|
+
edition.receive_fact_check(false)
|
102
102
|
edition.save(validate: false)
|
103
103
|
# Fact checks are processed async, so the user doesn't get an opportunity
|
104
104
|
# to retry without the content that (inadvertantly) fails validation, which happens frequently.
|
@@ -59,14 +59,25 @@ class WorkflowActorTest < ActiveSupport::TestCase
|
|
59
59
|
end
|
60
60
|
|
61
61
|
context "#receive_fact_check" do
|
62
|
-
|
63
|
-
edition = FactoryGirl.create(:guide_edition_with_two_parts, state: :fact_check)
|
62
|
+
setup do
|
63
|
+
@edition = FactoryGirl.create(:guide_edition_with_two_parts, state: :fact_check)
|
64
64
|
# Internal links must start with a forward slash eg [link text](/link-destination)
|
65
|
-
edition.parts.first.update_attribute(:body,
|
65
|
+
@edition.parts.first.update_attribute(:body,
|
66
|
+
"[register and tax your vehicle](registering-an-imported-vehicle)")
|
67
|
+
end
|
68
|
+
|
69
|
+
should "transition an edition with link validation errors to fact_check_received state" do
|
70
|
+
assert @edition.invalid?
|
71
|
+
assert User.new.receive_fact_check(@edition, {})
|
72
|
+
assert_equal "fact_check_received", @edition.reload.state
|
73
|
+
end
|
74
|
+
|
75
|
+
should "record the action" do
|
76
|
+
user = User.new
|
77
|
+
user.receive_fact_check(@edition, {})
|
66
78
|
|
67
|
-
|
68
|
-
|
69
|
-
assert_equal "fact_check_received", edition.reload.state
|
79
|
+
assert_equal 1, @edition.actions.count
|
80
|
+
assert_equal "receive_fact_check", @edition.actions.last.request_type
|
70
81
|
end
|
71
82
|
end
|
72
83
|
|
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: 14.1.
|
4
|
+
version: 14.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -466,7 +466,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
466
466
|
version: '0'
|
467
467
|
segments:
|
468
468
|
- 0
|
469
|
-
hash:
|
469
|
+
hash: 2394194236032864468
|
470
470
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
471
471
|
none: false
|
472
472
|
requirements:
|
@@ -475,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
475
475
|
version: '0'
|
476
476
|
segments:
|
477
477
|
- 0
|
478
|
-
hash:
|
478
|
+
hash: 2394194236032864468
|
479
479
|
requirements: []
|
480
480
|
rubyforge_project:
|
481
481
|
rubygems_version: 1.8.23
|