mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Added baumspage roster importer
This commit is contained in:
@@ -53,6 +53,21 @@ class SchoolsControllerTest < ActionController::TestCase
|
||||
assert_redirected_to '/static_pages/not_allowed'
|
||||
end
|
||||
|
||||
def baums_import
|
||||
baums_text = "***** 2019-01-09 13:36:50 *****
|
||||
Some School
|
||||
Some Guy
|
||||
106,,,,,,,,,
|
||||
113,Guy,Another,9,,,,,5,7
|
||||
120,Guy2,Another,9,,,,,0,0
|
||||
126,Guy3,Another,10,,,,5@120,2,2
|
||||
******* Extra Wrestlers *******
|
||||
120,Guy4,Another,10,0,3
|
||||
126,Guy5,Another,9,,"
|
||||
|
||||
post :import_baumspage_roster, params: { id: @school.id, school: { baums_text: baums_text } }
|
||||
end
|
||||
|
||||
test "logged in tournament owner should get edit school page" do
|
||||
sign_in_owner
|
||||
get_edit
|
||||
@@ -172,4 +187,22 @@ class SchoolsControllerTest < ActionController::TestCase
|
||||
success
|
||||
end
|
||||
|
||||
test "logged in school delegate can import baumspage roster" do
|
||||
sign_in_school_delegate
|
||||
baums_import
|
||||
assert_redirected_to "/schools/#{@school.id}"
|
||||
end
|
||||
|
||||
test "logged in tournament delegate can import baumspage roster" do
|
||||
sign_in_tournament_delegate
|
||||
baums_import
|
||||
assert_redirected_to "/schools/#{@school.id}"
|
||||
end
|
||||
|
||||
test "logged in user cannot import baumspage roster" do
|
||||
sign_in_non_owner
|
||||
baums_import
|
||||
redirect
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user