mirror of
https://github.com/discourse/discourse.git
synced 2024-12-25 05:53:42 +08:00
32171ad286
https://meta.discourse.org/t/broken-image-in-discobot-certificate-with-no-logo-small-url/76594/2
25 lines
638 B
Ruby
25 lines
638 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe DiscourseNarrativeBot::CertificateGenerator do
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
describe 'when an invalid date is given' do
|
|
it 'should default to the current date' do
|
|
expect { described_class.new(user, "2017-00-10") }.to_not raise_error
|
|
end
|
|
end
|
|
|
|
describe '#logo_group' do
|
|
describe 'when SiteSetting.logo_small_url is blank' do
|
|
before do
|
|
SiteSetting.logo_small_url = ''
|
|
end
|
|
|
|
it 'should not try to fetch a image' do
|
|
expect(described_class.new(user, "2017-02-10").send(:logo_group, 1, 1, 1))
|
|
.to eq(nil)
|
|
end
|
|
end
|
|
end
|
|
end
|