2017-12-22 09:29:35 +08:00
|
|
|
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
|
2017-12-22 09:30:24 +08:00
|
|
|
|
|
|
|
describe '#logo_group' do
|
2018-11-14 15:03:02 +08:00
|
|
|
describe 'when SiteSetting.site_logo_small_url is blank' do
|
2017-12-22 09:30:24 +08:00
|
|
|
before do
|
2018-11-14 15:03:02 +08:00
|
|
|
SiteSetting.logo_small = ''
|
2017-12-22 09:30:24 +08:00
|
|
|
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
|
2017-12-22 09:29:35 +08:00
|
|
|
end
|