1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Upgraded to rails 8.0.2, moved from dalli to solid cache, moved from delayed_job to solid queue, and add solid cable. deploy/rails-dev-run.sh no longer needs to chmod. Fixed finished_at callback for matches. Migrated from Devise to built in rails auth. Added view tests for the bracket page testing that all bout numbers render for all matches in each bracket type.

This commit is contained in:
2025-04-08 17:54:42 -04:00
parent 9c25a6cc39
commit 2d433b680a
118 changed files with 4921 additions and 1341 deletions

View File

@@ -13,6 +13,20 @@ class ActiveSupport::TestCase
# Add more helper methods to be used by all tests here...
# Authentication helpers for tests - replaces Devise test helpers
def sign_in(user)
# Set the password_digest for the user if it's not already set
unless user.password_digest.present?
user.password_digest = BCrypt::Password.create("password")
user.save(validate: false)
end
# For controller tests
if defined?(@request)
@request.session[:user_id] = user.id
end
end
def create_a_tournament_with_single_weight(tournament_type, number_of_wrestlers)
@tournament = Tournament.new
@tournament.name = "Test Tournament"
@@ -320,3 +334,18 @@ class ActiveSupport::TestCase
end
end
# Add support for controller tests
class ActionController::TestCase
# Authentication helpers for tests - replaces Devise test helpers
def sign_in(user)
# Set the password_digest for the user if it's not already set
unless user.password_digest.present?
user.password_digest = BCrypt::Password.create("password")
user.save(validate: false)
end
# Set the session for the controller test
@request.session[:user_id] = user.id
end
end