Merge commit 'a27bafa59653328a0f06bedb1dfb2b6ee92af43d' into glitch-soc/merge-upstream

- `app/controllers/application_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `spec/helpers/application_helper_spec.rb`:
  Minor conflict due to glitch-soc's theming system.
This commit is contained in:
Claire
2024-12-01 17:36:49 +01:00
83 changed files with 1330 additions and 441 deletions

View File

@@ -5,13 +5,21 @@ require 'rails_helper'
RSpec.describe ApplicationHelper do
describe 'body_classes' do
context 'with a body class string from a controller' do
before { helper.extend controller_helpers }
before do
user = Fabricate :user
user.settings['web.use_system_font'] = true
user.settings['web.reduce_motion'] = true
user.save
it 'uses the controller body classes in the result' do
helper.extend controller_helpers
end
it 'uses the current theme and user settings classes in the result' do
expect(helper.body_classes)
.to match(/modal-layout compose-standalone/)
.and match(/flavour-glitch/)
.to match(/flavour-glitch/)
.and match(/skin-default/)
.and match(/system-font/)
.and match(/reduce-motion/)
end
it 'includes values set via content_for' do
@@ -25,11 +33,8 @@ RSpec.describe ApplicationHelper do
def controller_helpers
Module.new do
def body_class_string = 'modal-layout compose-standalone'
def body_class_string = 'modal-layout compose-standalone'
def current_account
@current_account ||= Fabricate(:account)
@current_account ||= Fabricate(:account, user: User.last)
end
def current_flavour = 'glitch'