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

Added manual pool order button

This commit is contained in:
2020-01-14 14:54:24 -05:00
parent 521067d4c0
commit ac0cdc25a3
4 changed files with 76 additions and 23 deletions

View File

@@ -29,6 +29,10 @@ class WeightsControllerTest < ActionController::TestCase
def get_edit
get :edit, params: { id: @weight.id }
end
def get_pool_order
post :pool_order, params: {pool_to_order: 1, id: @weight.id}
end
def sign_in_owner
sign_in users(:one)
@@ -182,6 +186,30 @@ class WeightsControllerTest < ActionController::TestCase
redirect
end
test "logged in tournament owner can calculate a pool" do
sign_in_owner
get_pool_order
assert_redirected_to tournament_path(@tournament.id)
end
test "logged in tournament delegate can calculate a pool" do
sign_in_tournament_delegate
get_pool_order
assert_redirected_to tournament_path(@tournament.id)
end
test "logged in user not tournament owner cannot calculate a pool" do
sign_in_non_owner
get_pool_order
redirect
end
test "logged school delegate not tournament owner cannot calculate a pool" do
sign_in_school_delegate
get_pool_order
redirect
end
test "view wegiht" do
get :show, params: { id: 1 }
success