Skip to content

Commit c7f7bc4

Browse files
davezuckermanDavid Zuckerman
andauthored
Specifying UTC for jobs_helper and alma user model (#26)
Specifying UTC for Time Co-authored-by: David Zuckerman <dzuckerm@library.berkeley.edu>
1 parent 2dbb9ee commit c7f7bc4

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

app/models/alma/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def add_note(text)
107107
'user_viewable' => false,
108108
'popup_note' => false,
109109
'created_by' => 'Framework',
110-
'created_date' => Time.zone.now.strftime('%Y-%m-%dT%H:%M:00Z'),
110+
'created_date' => Time.now.utc.strftime('%Y-%m-%dT%H:%M:00Z'),
111111
'segment_type' => 'Internal'
112112
}
113113
user_obj['user_note'].push(new_note)

spec/jobs_helper.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
include_context 'ssh'
99
let(:job) { described_class }
1010
let(:alma_api_key) { 'totally-fake-key' }
11-
let(:today) { Time.now.strftime('%Y%m%d') }
11+
let(:today) { Time.now.utc.strftime('%Y%m%d') }
1212
let(:expected_note) { "#{today} #{note_text} [litscript]" }
1313

1414
attr_reader :patron
@@ -57,13 +57,12 @@
5757

5858
before do
5959
allow(Rails.application.config).to receive(:alma_api_key).and_return(alma_api_key)
60-
6160
stub_patron_dump(patron_id)
6261
@patron = Alma::User.find(patron_id)
6362
end
6463

6564
describe 'success' do
66-
let(:today) { Time.now.strftime('%Y%m%d') }
65+
let(:today) { Time.now.utc.strftime('%Y%m%d') }
6766
let(:expected_note) { "#{today} #{note_text} [litscript]" }
6867

6968
it 'adds the expected note' do # rubocop:disable RSpec/NoExpectationExample

0 commit comments

Comments
 (0)