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