2024-09-05 22:54:38 +02:00
|
|
|
# frozen_string_literal: true
|
2024-07-24 01:48:27 +02:00
|
|
|
|
2024-09-05 22:54:38 +02:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
|
class BackupsControllerTest < ActionDispatch::IntegrationTest
|
2024-09-22 22:49:53 +02:00
|
|
|
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
|
|
|
|
|
|
2024-09-05 22:54:38 +02:00
|
|
|
test "should show admin_backup" do
|
|
|
|
|
get admin_backup_url(@admin_backup)
|
|
|
|
|
assert_response :success
|
|
|
|
|
end
|
2024-07-24 01:48:27 +02:00
|
|
|
end
|
|
|
|
|
end
|