36 lines
811 B
Ruby
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
|