mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-30 12:20:35 +00:00
25 lines
664 B
Ruby
25 lines
664 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe Admin::Settings::BrandingController do
|
|
render_views
|
|
|
|
describe 'When signed in as an admin' do
|
|
before do
|
|
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')), scope: :user
|
|
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
|