mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Moving pages to tournament from static_pages
This commit is contained in:
@@ -9,10 +9,6 @@ class StaticPagesControllerTest < ActionController::TestCase
|
||||
@school = @tournament.schools.first
|
||||
end
|
||||
|
||||
def new
|
||||
get :new, tournament: @tournament.id
|
||||
end
|
||||
|
||||
def sign_in_owner
|
||||
sign_in users(:one)
|
||||
end
|
||||
@@ -29,17 +25,6 @@ class StaticPagesControllerTest < ActionController::TestCase
|
||||
assert_redirected_to '/static_pages/not_allowed'
|
||||
end
|
||||
|
||||
test "logged in tournament owner can generate matches" do
|
||||
sign_in_owner
|
||||
get :generate_matches, tournament: 1
|
||||
success
|
||||
end
|
||||
|
||||
test "logged in non tournament owner cannot generate matches" do
|
||||
sign_in_non_owner
|
||||
get :generate_matches, tournament: 1
|
||||
redirect
|
||||
end
|
||||
|
||||
test "logged in tournament owner can access weigh_ins" do
|
||||
sign_in_owner
|
||||
|
||||
@@ -1,11 +1,39 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TournamentsControllerTest < ActionController::TestCase
|
||||
# setup do
|
||||
# @tournament = tournaments(:one)
|
||||
# end
|
||||
include Devise::TestHelpers
|
||||
|
||||
setup do
|
||||
@tournament = Tournament.find(1)
|
||||
@tournament.generateMatchups
|
||||
@school = @tournament.schools.first
|
||||
end
|
||||
|
||||
def sign_in_owner
|
||||
sign_in users(:one)
|
||||
end
|
||||
|
||||
def sign_in_non_owner
|
||||
sign_in users(:two)
|
||||
end
|
||||
|
||||
def success
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def redirect
|
||||
assert_redirected_to '/static_pages/not_allowed'
|
||||
end
|
||||
test "logged in tournament owner can generate matches" do
|
||||
sign_in_owner
|
||||
get :generate_matches, id: 1
|
||||
success
|
||||
end
|
||||
|
||||
test "logged in non tournament owner cannot generate matches" do
|
||||
sign_in_non_owner
|
||||
get :generate_matches, id: 1
|
||||
redirect
|
||||
end
|
||||
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user