Skip to content

Commit b947da1

Browse files
committed
Retain draft state when English version is made live
When we make the English version of a form live, we want the form state to be 'live_with_draft' rather than 'live' - this reflects the fact that the form still has changes to be made live.
1 parent 3bcfaa1 commit b947da1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/state_machines/form_state_machine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module FormStateMachine
3737
before :before_make_english_live
3838
after :after_make_english_live
3939

40-
transitions from: %i[draft live live_with_draft archived_with_draft], to: :live, guard: :can_make_english_version_live?
40+
transitions from: %i[draft live live_with_draft archived_with_draft], to: :live_with_draft, guard: :can_make_english_version_live?
4141
end
4242

4343
event :make_welsh_version_live do

spec/state_machines/form_state_machine_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def after_archive; end
118118
end
119119

120120
it "transitions to live state" do
121-
expect(form).to transition_from(form_state).to(:live).on_event(:make_english_version_live)
121+
expect(form).to transition_from(form_state).to(:live_with_draft).on_event(:make_english_version_live)
122122
end
123123

124124
it "calls the before_make_english_live callback" do

0 commit comments

Comments
 (0)