mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Groundwork for user-selectable theme components
* Phase 0 for user-selectable theme components - Drops `key` column from the `themes` table - Drops `theme_key` column from the `user_options` table - Adds `theme_ids` (array of ints default []) column to the `user_options` table and migrates data from `theme_key` to the new column. - Removes the `default_theme_key` site setting and adds `default_theme_id` instead. - Replaces `theme_key` cookie with a new one called `theme_ids` - no longer need Theme.settings_for_client
This commit is contained in:
@@ -144,25 +144,25 @@ describe Admin::ThemesController do
|
||||
let(:theme) { Theme.create(name: 'my name', user_id: -1) }
|
||||
|
||||
it 'can change default theme' do
|
||||
SiteSetting.default_theme_key = nil
|
||||
SiteSetting.default_theme_id = -1
|
||||
|
||||
put "/admin/themes/#{theme.id}.json", params: {
|
||||
id: theme.id, theme: { default: true }
|
||||
}
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(SiteSetting.default_theme_key).to eq(theme.key)
|
||||
expect(SiteSetting.default_theme_id).to eq(theme.id)
|
||||
end
|
||||
|
||||
it 'can unset default theme' do
|
||||
SiteSetting.default_theme_key = theme.key
|
||||
SiteSetting.default_theme_id = theme.id
|
||||
|
||||
put "/admin/themes/#{theme.id}.json", params: {
|
||||
theme: { default: false }
|
||||
}
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(SiteSetting.default_theme_key).to be_blank
|
||||
expect(SiteSetting.default_theme_id).to eq(-1)
|
||||
end
|
||||
|
||||
it 'updates a theme' do
|
||||
|
||||
Reference in New Issue
Block a user