FIX: Imported themes should set their color scheme automatically

This commit is contained in:
David Taylor
2019-01-31 17:45:11 +00:00
parent b3a41878ec
commit 43f3bf71ba
2 changed files with 11 additions and 0 deletions

View File

@@ -102,6 +102,9 @@ describe RemoteTheme do
expect(scheme.name).to eq("Amazing")
expect(scheme.colors.find_by(name: 'love').hex).to eq('fafafa')
expect(@theme.color_scheme_id).to eq(scheme.id)
@theme.update(color_scheme_id: nil)
File.write("#{initial_repo}/common/header.html", "I AM UPDATED")
File.write("#{initial_repo}/about.json", about_json(love_color: "EAEAEA", about_url: "https://newsite.com/about"))
@@ -125,6 +128,7 @@ describe RemoteTheme do
scheme = ColorScheme.find_by(theme_id: @theme.id)
expect(scheme.name).to eq("Amazing")
expect(scheme.colors.find_by(name: 'love').hex).to eq('eaeaea')
expect(@theme.color_scheme_id).to eq(nil) # Should only be set on first import
mapped = Hash[*@theme.theme_fields.map { |f| ["#{f.target_id}-#{f.name}", f.value] }.flatten]