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

Added all_results page to tournaments

This commit is contained in:
2025-03-11 12:32:18 -04:00
parent 91e1939e69
commit 010d9a5f6b
7 changed files with 118 additions and 4 deletions

View File

@@ -471,6 +471,87 @@ class TournamentsControllerTest < ActionController::TestCase
end
# END UP MATCHES PAGE PERMISSIONS
# ALL_RESULTS PAGE PERMISSIONS WHEN TOURNAMENT IS NOT PUBLIC
test "logged in school delegate cannot get all_results page when tournament is not public" do
@tournament.is_public = false
@tournament.save
sign_in_school_delegate
get :all_results, params: { id: 1 }
redirect
end
test "logged in user cannot get all_results page when tournament is not public" do
@tournament.is_public = false
@tournament.save
sign_in_non_owner
get :all_results, params: { id: 1 }
redirect
end
test "logged in tournament delegate can get all_results page when tournament is not public" do
@tournament.is_public = false
@tournament.save
sign_in_delegate
get :all_results, params: { id: 1 }
success
end
test "logged in tournament owner can get all_results page when tournament is not public" do
@tournament.is_public = false
@tournament.save
sign_in_owner
get :all_results, params: { id: 1 }
success
end
test "non logged in user cannot get all_results page when tournament is not public" do
@tournament.is_public = false
@tournament.save
get :all_results, params: { id: 1 }
redirect
end
# ALL_RESULTS PAGE PERMISSIONS WHEN TOURNAMENT IS PUBLIC
test "logged in school delegate can get all_results page when tournament is public" do
@tournament.is_public = true
@tournament.save
sign_in_school_delegate
get :all_results, params: { id: 1 }
success
end
test "logged in user can get all_results page when tournament is public" do
@tournament.is_public = true
@tournament.save
sign_in_non_owner
get :all_results, params: { id: 1 }
success
end
test "logged in tournament delegate can get all_results page when tournament is public" do
@tournament.is_public = true
@tournament.save
sign_in_delegate
get :all_results, params: { id: 1 }
success
end
test "logged in tournament owner can get all_results page when tournament is public" do
@tournament.is_public = true
@tournament.save
sign_in_owner
get :all_results, params: { id: 1 }
success
end
test "non logged in user can get all_results page when tournament is public" do
@tournament.is_public = true
@tournament.save
get :all_results, params: { id: 1 }
success
end
# END ALL_RESULTS PAGE PERMISSIONS
#TESTS THAT NEED MATCHES PUT ABOVE THIS
test "redirect up_matches if no matches" do
sign_in_owner