Update tests
parent
3742ba9c32
commit
afac64c98c
|
@ -5,10 +5,8 @@ class ImageSerializer < ActiveModel::Serializer
|
|||
def attachment_url
|
||||
url_ = object.attachment.url("x640")
|
||||
# Force google cloud users to use HTTPS://
|
||||
if Api::ImagesController::KEY.present?
|
||||
return url_.gsub("http://", "https://")
|
||||
else
|
||||
return url_
|
||||
end
|
||||
x = Api::ImagesController::KEY.present? ?
|
||||
url_.gsub("http://", "https://") : url_
|
||||
return x
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
require "spec_helper"
|
||||
|
||||
describe CreateAttachmentFromUrlJob do
|
||||
it "Has a max_attempts property of 2" do
|
||||
expect(CreateAttachmentFromUrlJob.new.max_attempts).to eq(2)
|
||||
end
|
||||
end
|
|
@ -25,4 +25,12 @@ describe Device do
|
|||
device.timezone = "America/Chicago"
|
||||
expect([-5, -6, -7]).to include device.tz_offset_hrs # Remember DST!
|
||||
end
|
||||
|
||||
it 'trims the log list as needed' do
|
||||
device.update_attributes(max_log_count: 3)
|
||||
FactoryBot.create_list(:log, 5, device: device)
|
||||
expect(device.logs.count).to eq(5)
|
||||
device.trim_log_list!
|
||||
expect(device.logs.count).to eq(device.max_log_count)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue