mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 08:43:43 +08:00
c9dab6fd08
It's very easy to forget to add `require 'rails_helper'` at the top of every core/plugin spec file, and omissions can cause some very confusing/sporadic errors. By setting this flag in `.rspec`, we can remove the need for `require 'rails_helper'` entirely.
27 lines
746 B
Ruby
27 lines
746 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe DiscourseNarrativeBot::CertificateGenerator do
|
|
let(:user) { Fabricate(:user) }
|
|
let(:avatar_url) { 'http://test.localhost/cdn/avatar.png' }
|
|
let(:date) { "2017-00-10" }
|
|
|
|
describe 'when an invalid date is given' do
|
|
it 'should default to the current date' do
|
|
expect { described_class.new(user, date, avatar_url) }.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 = ''
|
|
end
|
|
|
|
it 'should not try to fetch a image' do
|
|
expect(described_class.new(user, date, avatar_url).send(:logo_group, 1, 1, 1))
|
|
.to eq(nil)
|
|
end
|
|
end
|
|
end
|
|
end
|