You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
810 B
27 lines
810 B
# frozen_string_literal: true |
|
|
|
require 'rails_helper' |
|
|
|
RSpec.describe 'Admin SiteUploads' do |
|
let(:user) { Fabricate(:admin_user) } |
|
|
|
before { sign_in(user) } |
|
|
|
describe 'Removing a site upload' do |
|
let!(:site_upload) { Fabricate(:site_upload, var: 'thumbnail') } |
|
|
|
it 'removes the upload and redirects' do |
|
visit admin_settings_branding_path |
|
expect(page) |
|
.to have_title(I18n.t('admin.settings.branding.title')) |
|
|
|
expect { click_on I18n.t('admin.site_uploads.delete') } |
|
.to change(SiteUpload, :count).by(-1) |
|
expect { site_upload.reload } |
|
.to raise_error(ActiveRecord::RecordNotFound) |
|
expect(page) |
|
.to have_content(I18n.t('admin.site_uploads.destroyed_msg')) |
|
.and have_title(I18n.t('admin.settings.branding.title')) |
|
end |
|
end |
|
end
|
|
|