forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add request spec for backups download (mastodon#25099)
- Loading branch information
1 parent
ca66e61
commit c9f980b
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe 'Backups' do | ||
include RoutingHelper | ||
|
||
describe 'GET backups#download' do | ||
let(:user) { Fabricate(:user) } | ||
let(:backup) { Fabricate(:backup, user: user) } | ||
|
||
before do | ||
sign_in user | ||
end | ||
|
||
it 'Downloads a user backup' do | ||
get download_backup_path(backup) | ||
|
||
expect(response).to redirect_to(backup_dump_url) | ||
end | ||
|
||
def backup_dump_url | ||
full_asset_url(backup.dump.url) | ||
end | ||
end | ||
end |