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:
Sam
2017-04-14 13:35:12 -04:00
parent 8370b4b1b7
commit def7348777
14 changed files with 113 additions and 50 deletions

View File

@ -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