mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-24 21:45:06 +01:00
Add spec for Settings::ExportsController#create (#9512)
This commit is contained in:
parent
55abff8af7
commit
795bac44fd
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe Settings::ExportsController do
|
||||
@ -28,4 +30,23 @@ describe Settings::ExportsController do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #create' do
|
||||
before do
|
||||
sign_in Fabricate(:user), scope: :user
|
||||
end
|
||||
|
||||
it 'redirects to settings_export_path' do
|
||||
post :create
|
||||
expect(response).to redirect_to(settings_export_path)
|
||||
end
|
||||
|
||||
it 'queues BackupWorker job by 1' do
|
||||
Sidekiq::Testing.fake! do
|
||||
expect do
|
||||
post :create
|
||||
end.to change(BackupWorker.jobs, :size).by(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user