Appease the dog overlords

This commit is contained in:
Andreas Nedbal 2022-06-26 03:07:59 +02:00 committed by Karina Kwiatek
parent 8f8ebaf77b
commit 417eee2ddc
2 changed files with 37 additions and 38 deletions

View File

@ -3,23 +3,22 @@ class Settings::ThemeController < ApplicationController
before_action :authenticate_user!
def edit
end
def edit; end
def update
update_attributes = params.require(:theme).permit([
:primary_color, :primary_text,
:danger_color, :danger_text,
:success_color, :success_text,
:warning_color, :warning_text,
:info_color, :info_text,
:dark_color, :dark_text,
:light_color, :light_text,
:raised_background, :raised_accent,
:background_color, :body_text,
:muted_text, :input_color,
:input_text
])
update_attributes = params.require(:theme).permit(%i[
primary_color primary_text
danger_color danger_text
success_color success_text
warning_color warning_text
info_color info_text
dark_color dark_text
light_color light_text
raised_background raised_accent
background_color body_text
muted_text input_color
input_text
])
if current_user.theme.nil?
current_user.theme = Theme.new update_attributes

View File

@ -21,31 +21,31 @@ describe Settings::ThemeController, type: :controller do
describe "#update" do
let(:user) { FactoryBot.create(:user) }
let(:update_attributes) do
{
let(:update_attributes) do
{
theme: {
primary_color: 6174129,
primary_text: 16777215,
danger_color: 14431557,
danger_text: 16777215,
success_color: 2664261,
success_text: 16777215,
warning_color: 16761095,
warning_text: 2697513,
info_color: 1548984,
info_text: 16777215,
dark_color: 3422784,
dark_text: 15658734,
light_color: 16316922,
light_text: 0,
primary_color: 6174129,
primary_text: 16777215,
danger_color: 14431557,
danger_text: 16777215,
success_color: 2664261,
success_text: 16777215,
warning_color: 16761095,
warning_text: 2697513,
info_color: 1548984,
info_text: 16777215,
dark_color: 3422784,
dark_text: 15658734,
light_color: 16316922,
light_text: 0,
raised_background: 16777215,
raised_accent: 16250871,
background_color: 15789556,
body_text: 0,
muted_text: 7107965,
input_color: 15789556,
input_text: 0
}
raised_accent: 16250871,
background_color: 15789556,
body_text: 0,
muted_text: 7107965,
input_color: 15789556,
input_text: 0
}
}
end