add controller tests

This commit is contained in:
2026-01-23 12:20:31 +01:00
parent dea0ef508a
commit 35c29749fb
16 changed files with 515 additions and 51 deletions
+19 -2
View File
@@ -4,8 +4,8 @@ require "rails/test_help"
module ActiveSupport
class TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Run tests serially to avoid sqlite/FTS5 conflicts in test setup.
parallelize(workers: 1)
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
@@ -13,3 +13,20 @@ module ActiveSupport
# Add more helper methods to be used by all tests here...
end
end
module ActionDispatch
class IntegrationTest
# Helper method to login as a user in integration tests
def login_as(user, password: "password123456")
post login_path, params: {
email: user.email,
password: password
}
end
# Helper method to logout
def logout
delete logout_path
end
end
end