mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 21:36:11 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
28 lines
710 B
Ruby
28 lines
710 B
Ruby
# frozen_string_literal: true
|
|
|
|
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.site_logo_small_url is blank' do
|
|
before do
|
|
SiteSetting.logo_small = ''
|
|
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
|