Add tests for `ExportController#create`

This commit is contained in:
Andreas Nedbal 2022-07-02 14:51:25 +02:00
parent b17df72b61
commit 0ed0d34682
1 changed files with 20 additions and 0 deletions

View File

@ -17,4 +17,24 @@ describe Settings::ExportController, type: :controller do
end
end
end
describe "#create" do
subject { post :create }
context "user signed in" do
let(:user) { FactoryBot.create(:user) }
before { sign_in user }
it "enqueues an ExportWorker job" do
subject
expect(ExportWorker).to have_enqueued_sidekiq_job(user.id)
end
it "redirects to the export page" do
subject
expect(response).to redirect_to(:settings_export)
end
end
end
end