Refactor theme fields so they support custom theme defined vars

This paves the way to allowing themes to specify uploads and so on.
This commit is contained in:
Sam
2017-05-02 16:01:01 -04:00
parent 1f6ffd5fb0
commit 946f25098f
14 changed files with 120 additions and 52 deletions

View File

@ -14,8 +14,8 @@ describe Admin::ThemesController do
context ' .index' do
it 'returns success' do
theme = Theme.new(name: 'my name', user_id: -1)
theme.set_field(:common, :scss, '.body{color: black;}')
theme.set_field(:desktop, :after_header, '<b>test</b>')
theme.set_field(target: :common, name: :scss, value: '.body{color: black;}')
theme.set_field(target: :desktop, name: :after_header, value: '<b>test</b>')
theme.remote_theme = RemoteTheme.new(
remote_url: 'awesome.git',
@ -71,7 +71,7 @@ describe Admin::ThemesController do
it 'updates a theme' do
#focus
theme = Theme.new(name: 'my name', user_id: -1)
theme.set_field(:common, :scss, '.body{color: black;}')
theme.set_field(target: :common, name: :scss, value: '.body{color: black;}')
theme.save
child_theme = Theme.create(name: 'my name', user_id: -1)