backups_spec.rb 490 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe 'Backups' do
  4. include RoutingHelper
  5. describe 'GET backups#download' do
  6. let(:user) { Fabricate(:user) }
  7. let(:backup) { Fabricate(:backup, user: user) }
  8. before do
  9. sign_in user
  10. end
  11. it 'Downloads a user backup' do
  12. get download_backup_path(backup)
  13. expect(response).to redirect_to(backup_dump_url)
  14. end
  15. def backup_dump_url
  16. full_asset_url(backup.dump.url)
  17. end
  18. end
  19. end