diff --git a/test/controllers/schools_controller_test.rb b/test/controllers/schools_controller_test.rb index d64f79c..f5c708e 100644 --- a/test/controllers/schools_controller_test.rb +++ b/test/controllers/schools_controller_test.rb @@ -106,5 +106,10 @@ class SchoolsControllerTest < ActionController::TestCase destroy redirect end + + test "view school" do + get :show, id: 1 + success + end end diff --git a/test/controllers/static_pages_controller_test.rb b/test/controllers/static_pages_controller_test.rb index 8aae91f..02471ee 100644 --- a/test/controllers/static_pages_controller_test.rb +++ b/test/controllers/static_pages_controller_test.rb @@ -25,6 +25,10 @@ class StaticPagesControllerTest < ActionController::TestCase assert_redirected_to '/static_pages/not_allowed' end - + test "get root page" do + get :home + success + end + end diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb index bda742e..ba147f6 100644 --- a/test/controllers/tournaments_controller_test.rb +++ b/test/controllers/tournaments_controller_test.rb @@ -7,6 +7,7 @@ include Devise::TestHelpers @tournament = Tournament.find(1) @tournament.generateMatchups @school = @tournament.schools.first + @wrestlers = @tournament.weights.first.wrestlers end def post_update @@ -93,6 +94,17 @@ include Devise::TestHelpers get :weigh_in_weight, id: 1, weight: 1 redirect end + + test "logged in tournament owner can access post weigh_in_weight" do + sign_in_owner + post :weigh_in, id: 1, weight: 1, wrestler: @wrestlers + end + + test "logged in non tournament owner cannot access post weigh_in_weight" do + sign_in_non_owner + post :weigh_in_weight, id: 1, weight: 1, wrestler: @wrestlers + redirect + end test "logged in tournament owner should get edit tournament page" do diff --git a/test/controllers/weights_controller_test.rb b/test/controllers/weights_controller_test.rb index dbb80cc..93c2c3c 100644 --- a/test/controllers/weights_controller_test.rb +++ b/test/controllers/weights_controller_test.rb @@ -107,5 +107,9 @@ class WeightsControllerTest < ActionController::TestCase redirect end + test "view wegiht" do + get :show, id: 1 + success + end end diff --git a/test/controllers/wrestlers_controller_test.rb b/test/controllers/wrestlers_controller_test.rb index 527e638..cc171bd 100644 --- a/test/controllers/wrestlers_controller_test.rb +++ b/test/controllers/wrestlers_controller_test.rb @@ -108,6 +108,10 @@ class WrestlersControllerTest < ActionController::TestCase redirect end + test "view wrestler" do + get :show, id: @wrestler.id + success + end end