mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08: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:
@ -34,12 +34,12 @@ describe Middleware::AnonymousCache::Helper do
|
||||
it "handles theme keys" do
|
||||
theme = Theme.create(name: "test", user_id: -1, user_selectable: true)
|
||||
|
||||
with_bad_theme_key = new_helper("HTTP_COOKIE" => "theme_key=abc").cache_key
|
||||
with_bad_theme_key = new_helper("HTTP_COOKIE" => "theme_ids=abc").cache_key
|
||||
with_no_theme_key = new_helper().cache_key
|
||||
|
||||
expect(with_bad_theme_key).to eq(with_no_theme_key)
|
||||
|
||||
with_good_theme_key = new_helper("HTTP_COOKIE" => "theme_key=#{theme.key}").cache_key
|
||||
with_good_theme_key = new_helper("HTTP_COOKIE" => "theme_ids=#{theme.id}").cache_key
|
||||
|
||||
expect(with_good_theme_key).not_to eq(with_no_theme_key)
|
||||
end
|
||||
|
Reference in New Issue
Block a user