From 7ce6642a6fd5208e5b20e55337f5bc37e6872725 Mon Sep 17 00:00:00 2001 From: David Zuckerman Date: Wed, 18 Feb 2026 12:33:50 -0800 Subject: [PATCH] Specifying UTC for jobs_helper and alma user model Fixed syntax error with Time.now in user model --- app/models/alma/user.rb | 2 +- spec/jobs_helper.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/alma/user.rb b/app/models/alma/user.rb index 69143d35..8412de53 100644 --- a/app/models/alma/user.rb +++ b/app/models/alma/user.rb @@ -107,7 +107,7 @@ def add_note(text) 'user_viewable' => false, 'popup_note' => false, 'created_by' => 'Framework', - 'created_date' => Time.zone.now.strftime('%Y-%m-%dT%H:%M:00Z'), + 'created_date' => Time.now.utc.strftime('%Y-%m-%dT%H:%M:00Z'), 'segment_type' => 'Internal' } user_obj['user_note'].push(new_note) diff --git a/spec/jobs_helper.rb b/spec/jobs_helper.rb index 58c8a361..1d2706e1 100644 --- a/spec/jobs_helper.rb +++ b/spec/jobs_helper.rb @@ -8,7 +8,7 @@ include_context 'ssh' let(:job) { described_class } let(:alma_api_key) { 'totally-fake-key' } - let(:today) { Time.now.strftime('%Y%m%d') } + let(:today) { Time.now.utc.strftime('%Y%m%d') } let(:expected_note) { "#{today} #{note_text} [litscript]" } attr_reader :patron @@ -57,13 +57,12 @@ before do allow(Rails.application.config).to receive(:alma_api_key).and_return(alma_api_key) - stub_patron_dump(patron_id) @patron = Alma::User.find(patron_id) end describe 'success' do - let(:today) { Time.now.strftime('%Y%m%d') } + let(:today) { Time.now.utc.strftime('%Y%m%d') } let(:expected_note) { "#{today} #{note_text} [litscript]" } it 'adds the expected note' do # rubocop:disable RSpec/NoExpectationExample