Move theme-related helper methods out of controller (#37807)

This commit is contained in:
Matt Jankowski
2026-02-10 10:34:42 -05:00
committed by GitHub
parent 040555be7f
commit 34514bcfe9
5 changed files with 72 additions and 37 deletions

View File

@@ -85,20 +85,6 @@ RSpec.describe ApplicationController do
end
end
describe 'helper_method :current_theme' do
it 'returns "default" when theme wasn\'t changed in admin settings' do
allow(Setting).to receive(:default_settings).and_return({ 'theme' => 'default' })
expect(controller.view_context.current_theme).to eq 'default'
end
it 'returns instances\'s theme when user is not signed in' do
allow(Setting).to receive(:[]).with('theme').and_return 'contrast'
expect(controller.view_context.current_theme).to eq 'contrast'
end
end
context 'with ActionController::RoutingError' do
subject do
routes.draw { get 'routing_error' => 'anonymous#routing_error' }