Add "data export" feature
- Adds a button in Account Settings where you can request a ZIP export of your Fizzy data - Export files are created in the background. When ready, a link to download them is sent to the requester. - Exports expire after 24 hours. And are limited to 10 per day.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
require "test_helper"
|
||||
|
||||
class ExportMailerTest < ActionMailer::TestCase
|
||||
test "completed" do
|
||||
export = Account::Export.create!(account: Current.account, user: users(:david))
|
||||
email = ExportMailer.completed(export)
|
||||
|
||||
assert_emails 1 do
|
||||
email.deliver_now
|
||||
end
|
||||
|
||||
assert_equal [ "david@37signals.com" ], email.to
|
||||
assert_equal "Your Fizzy export is ready", email.subject
|
||||
assert_match %r{/exports/#{export.id}}, email.body.encoded
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
class ExportMailerPreview < ActionMailer::Preview
|
||||
def completed
|
||||
export = Account::Export.new(
|
||||
id: "preview-export-id",
|
||||
account: Account.first,
|
||||
user: User.first
|
||||
)
|
||||
|
||||
ExportMailer.completed(export)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user