mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
39 lines
634 B
Ruby
39 lines
634 B
Ruby
require 'test_helper'
|
|
|
|
class StaticPagesControllerTest < ActionController::TestCase
|
|
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 "get root page" do
|
|
get :home
|
|
success
|
|
end
|
|
|
|
test "get my_tournaments" do
|
|
sign_in_owner
|
|
get :my_tournaments
|
|
success
|
|
end
|
|
end
|