a11yist/test/controllers/admin/backups_controller_test.rb
david fc71cd4a09
Some checks failed
/ Run tests (push) Failing after 16s
/ Run system tests (push) Failing after 14s
/ Build, push and deploy image (push) Has been skipped
improve backup
2024-10-27 03:38:15 +01:00

36 lines
811 B
Ruby

# frozen_string_literal: true
require "test_helper"
module Admin
class BackupsControllerTest < ActionDispatch::IntegrationTest
def login(email, password)
post "/login", params: { email: email, password: password }
assert_redirected_to "/"
end
def logout
post "/logout"
assert_redirected_to "/"
end
teardown do
logout
end
setup do
Account.create(email: "test@example.com", password: "password")
login("test@example.com", "password")
end
test "should create admin_backup xlsx" do
get admin_backup_url(@admin_backup, format: :xlsx)
assert_response :success
end
test "should create admin_backup zip" do
get admin_backup_url(@admin_backup, format: :zip)
assert_response :success
end
end
end