site_uploads_controller_spec.rb 508 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Admin::SiteUploadsController do
  4. render_views
  5. let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
  6. before do
  7. sign_in user, scope: :user
  8. end
  9. describe 'DELETE #destroy' do
  10. let(:site_upload) { Fabricate(:site_upload, var: 'thumbnail') }
  11. it 'returns http success' do
  12. delete :destroy, params: { id: site_upload.id }
  13. expect(response).to redirect_to(admin_settings_path)
  14. end
  15. end
  16. end