2020-10-14 22:29:40 +08:00
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
|
RSpec.describe 'Styleguide assets' do
|
2020-10-14 22:29:40 +08:00
|
|
|
|
before do
|
|
|
|
|
SiteSetting.styleguide_enabled = true
|
|
|
|
|
sign_in(Fabricate(:admin))
|
|
|
|
|
end
|
|
|
|
|
|
2022-07-28 00:14:14 +08:00
|
|
|
|
context 'when visiting homepage' do
|
2020-10-14 22:29:40 +08:00
|
|
|
|
it 'doesn’t load styleguide assets' do
|
|
|
|
|
get '/'
|
|
|
|
|
expect(response.body).to_not include('styleguide')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2022-07-28 00:14:14 +08:00
|
|
|
|
context 'when visiting styleguide' do
|
2020-10-14 22:29:40 +08:00
|
|
|
|
it 'loads styleguide assets' do
|
|
|
|
|
get '/styleguide'
|
|
|
|
|
expect(response.body).to include('styleguide')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|