mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:57:40 +08:00
FIX: display custom sections with default theme
also cleans up mechanism for previewing themes, cleans up naming, gets rid of old janky "preview_style", secures local theme key
This commit is contained in:
@ -137,5 +137,28 @@ HTML
|
||||
end
|
||||
end
|
||||
|
||||
it 'correctly caches theme keys' do
|
||||
theme = Theme.create!(name: "bob", user_id: -1)
|
||||
|
||||
expect(Theme.theme_keys).to eq(Set.new([theme.key]))
|
||||
expect(Theme.user_theme_keys).to eq(Set.new([]))
|
||||
|
||||
theme.user_selectable = true
|
||||
theme.save
|
||||
|
||||
expect(Theme.user_theme_keys).to eq(Set.new([theme.key]))
|
||||
|
||||
theme.user_selectable = false
|
||||
theme.save
|
||||
|
||||
theme.set_default!
|
||||
expect(Theme.user_theme_keys).to eq(Set.new([theme.key]))
|
||||
|
||||
theme.destroy
|
||||
|
||||
expect(Theme.theme_keys).to eq(Set.new([]))
|
||||
expect(Theme.user_theme_keys).to eq(Set.new([]))
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user