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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 14.1.1
2
+ * Use another way to transition Editions without
3
+ validation
4
+
1
5
  ## 14.1.0
2
6
  * Edition errors should not block receiving of
3
7
  fact check response, and related state transition.
@@ -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.state_event = :receive_fact_check
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.
@@ -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 = "14.1.0"
3
+ VERSION = "14.1.1"
4
4
  end
@@ -59,14 +59,25 @@ class WorkflowActorTest < ActiveSupport::TestCase
59
59
  end
60
60
 
61
61
  context "#receive_fact_check" do
62
- should "transition an edition with link validation errors to fact_check_received state" do
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, "[register and tax your vehicle](registering-an-imported-vehicle)")
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
- assert edition.invalid?
68
- assert User.new.receive_fact_check(edition, {})
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.0
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: -941845765885480404
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: -941845765885480404
478
+ hash: 2394194236032864468
479
479
  requirements: []
480
480
  rubyforge_project:
481
481
  rubygems_version: 1.8.23