Skip to content

Commit

Permalink
Always record timeline events
Browse files Browse the repository at this point in the history
When assessment sections are assessed we want to always record a
timeline event to ensure this is captured even if the status changes,
but the selected failure reasons might be different.
  • Loading branch information
thomasleese committed May 27, 2024
1 parent 16be95e commit 105fd7c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
5 changes: 1 addition & 4 deletions app/services/assess_assessment_section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,13 @@ def update_application_form_assessor
end

def create_timeline_event(old_status:)
new_status = assessment_section.status
return if old_status == new_status

CreateTimelineEvent.call(
"assessment_section_recorded",
application_form:,
user:,
assessment_section:,
old_value: old_status,
new_value: new_status,
new_value: assessment_section.status,
)
end

Expand Down
10 changes: 0 additions & 10 deletions spec/services/assess_assessment_section_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,4 @@
expect { call }.to_not change(assessment, :started_at)
end
end

context "when the state is the same" do
before { call }

it "doesn't record a timeline event" do
expect { call }.to_not have_recorded_timeline_event(
:assessment_section_recorded,
)
end
end
end

0 comments on commit 105fd7c

Please sign in to comment.