0
0
Fork 0

Convert admin/settings controller specs to system specs (#31548)

This commit is contained in:
Matt Jankowski 2024-09-03 11:29:32 -04:00 committed by GitHub
parent ef4920c6c9
commit 928390c2ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 170 additions and 162 deletions

View file

@ -10,14 +10,6 @@ RSpec.describe Admin::Settings::BrandingController do
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')), scope: :user
end
describe 'GET #show' do
it 'returns http success' do
get :show
expect(response).to have_http_status(200)
end
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
@ -27,15 +19,6 @@ RSpec.describe Admin::Settings::BrandingController do
expect(response).to redirect_to(admin_settings_branding_path)
expect(Setting.new_setting_key).to be_nil
end
it 'creates a settings value that didnt exist before for eligible key' do
expect(Setting.site_short_description).to be_blank
patch :update, params: { form_admin_settings: { site_short_description: 'New key value' } }
expect(response).to redirect_to(admin_settings_branding_path)
expect(Setting.site_short_description).to eq 'New key value'
end
end
end
end