2022-10-22 11:44:41 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-05-04 05:49:53 +02:00
|
|
|
RSpec.describe Admin::Settings::BrandingController do
|
2022-10-22 11:44:41 +02:00
|
|
|
render_views
|
|
|
|
|
|
|
|
describe 'When signed in as an admin' do
|
|
|
|
before do
|
2025-01-03 09:28:14 +01:00
|
|
|
sign_in Fabricate(:admin_user), scope: :user
|
2022-10-22 11:44:41 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'PUT #update' do
|
|
|
|
it 'cannot create a setting value for a non-admin key' do
|
|
|
|
expect(Setting.new_setting_key).to be_blank
|
|
|
|
|
|
|
|
patch :update, params: { form_admin_settings: { new_setting_key: 'New key value' } }
|
|
|
|
|
|
|
|
expect(response).to redirect_to(admin_settings_branding_path)
|
|
|
|
expect(Setting.new_setting_key).to be_nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|