add controller tests
This commit is contained in:
+19
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user