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

Added tests for assign_next_match mat action permissions

This commit is contained in:
2023-01-09 19:55:19 -05:00
parent 288c144f53
commit bde2b6d8c4
2 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ class MatsControllerTest < ActionController::TestCase
end
def post_assign_next_match
post :assign_next_match, params: { mat: {name: 'Mat100', tournament_id; 1} }
post :assign_next_match, params: { id: @mat.id }
end
def new
@@ -233,13 +233,13 @@ class MatsControllerTest < ActionController::TestCase
test "logged in tournament owner should post assign_next_match mat page" do
sign_in_owner
post_assign_next_match
success
assert_redirected_to "/tournaments/#{@mat.tournament_id}"
end
test "logged in tournament delegate should post assign_next_match mat page" do
sign_in_tournament_delegate
post_assign_next_match
success
assert_redirected_to "/tournaments/#{@mat.tournament_id}"
end
test "logged in user should not get post assign_next_match page if not owner" do