1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-02 04:35:26 +00:00

Cleaned scaffold tests and set up fixtures needed for now.

This commit is contained in:
2015-03-26 16:55:33 +00:00
parent a1fbcc4a9f
commit 819d735480
25 changed files with 522 additions and 343 deletions

View File

@@ -1,7 +1,7 @@
require 'test_helper'
class AdminControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
test "the truth" do
assert true
end
end

View File

@@ -1,49 +1,11 @@
require 'test_helper'
class MatchesControllerTest < ActionController::TestCase
setup do
@match = matches(:one)
end
# setup do
# @match = matches(:one)
# end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:matches)
end
test "should get new" do
get :new
assert_response :success
end
test "should create match" do
assert_difference('Match.count') do
post :create, match: { g_id: @match.g_id, g_stat: @match.g_stat, r_id: @match.r_id, r_stat: @match.r_stat, score: @match.score, win_type: @match.win_type, winner_id: @match.winner_id }
end
assert_redirected_to match_path(assigns(:match))
end
test "should show match" do
get :show, id: @match
assert_response :success
end
test "should get edit" do
get :edit, id: @match
assert_response :success
end
test "should update match" do
patch :update, id: @match, match: { g_id: @match.g_id, g_stat: @match.g_stat, r_id: @match.r_id, r_stat: @match.r_stat, score: @match.score, win_type: @match.win_type, winner_id: @match.winner_id }
assert_redirected_to match_path(assigns(:match))
end
test "should destroy match" do
assert_difference('Match.count', -1) do
delete :destroy, id: @match
end
assert_redirected_to matches_path
end
test "the truth" do
assert true
end
end

View File

@@ -1,49 +1,11 @@
require 'test_helper'
class MatsControllerTest < ActionController::TestCase
setup do
@mat = mats(:one)
end
# setup do
# @mat = mats(:one)
# end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:mats)
end
test "should get new" do
get :new
assert_response :success
end
test "should create mat" do
assert_difference('Mat.count') do
post :create, mat: { name: @mat.name, tournament_id: @mat.tournament_id }
end
assert_redirected_to mat_path(assigns(:mat))
end
test "should show mat" do
get :show, id: @mat
assert_response :success
end
test "should get edit" do
get :edit, id: @mat
assert_response :success
end
test "should update mat" do
patch :update, id: @mat, mat: { name: @mat.name, tournament_id: @mat.tournament_id }
assert_redirected_to mat_path(assigns(:mat))
end
test "should destroy mat" do
assert_difference('Mat.count', -1) do
delete :destroy, id: @mat
end
assert_redirected_to mats_path
end
test "the truth" do
assert true
end
end

View File

@@ -1,49 +1,11 @@
require 'test_helper'
class SchoolsControllerTest < ActionController::TestCase
setup do
@school = schools(:one)
end
# setup do
# @school = schools(:one)
# end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:schools)
end
test "should get new" do
get :new
assert_response :success
end
test "should create school" do
assert_difference('School.count') do
post :create, school: { name: @school.name, score: @school.score }
end
assert_redirected_to school_path(assigns(:school))
end
test "should show school" do
get :show, id: @school
assert_response :success
end
test "should get edit" do
get :edit, id: @school
assert_response :success
end
test "should update school" do
patch :update, id: @school, school: { name: @school.name, score: @school.score }
assert_redirected_to school_path(assigns(:school))
end
test "should destroy school" do
assert_difference('School.count', -1) do
delete :destroy, id: @school
end
assert_redirected_to schools_path
end
test "the truth" do
assert true
end
end

View File

@@ -1,7 +1,7 @@
require 'test_helper'
class StaticPagesControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
test "the truth" do
assert true
end
end

View File

@@ -1,49 +1,11 @@
require 'test_helper'
class TournamentsControllerTest < ActionController::TestCase
setup do
@tournament = tournaments(:one)
end
# setup do
# @tournament = tournaments(:one)
# end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:tournaments)
end
test "should get new" do
get :new
assert_response :success
end
test "should create tournament" do
assert_difference('Tournament.count') do
post :create, tournament: { address: @tournament.address, director: @tournament.director, director_email: @tournament.director_email, name: @tournament.name }
end
assert_redirected_to tournament_path(assigns(:tournament))
end
test "should show tournament" do
get :show, id: @tournament
assert_response :success
end
test "should get edit" do
get :edit, id: @tournament
assert_response :success
end
test "should update tournament" do
patch :update, id: @tournament, tournament: { address: @tournament.address, director: @tournament.director, director_email: @tournament.director_email, name: @tournament.name }
assert_redirected_to tournament_path(assigns(:tournament))
end
test "should destroy tournament" do
assert_difference('Tournament.count', -1) do
delete :destroy, id: @tournament
end
assert_redirected_to tournaments_path
end
test "the truth" do
assert true
end
end

View File

@@ -1,49 +1,11 @@
require 'test_helper'
class WeightsControllerTest < ActionController::TestCase
setup do
@weight = weights(:one)
end
# setup do
# @weight = weights(:one)
# end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:weights)
end
test "should get new" do
get :new
assert_response :success
end
test "should create weight" do
assert_difference('Weight.count') do
post :create, weight: { max: @weight.max }
end
assert_redirected_to weight_path(assigns(:weight))
end
test "should show weight" do
get :show, id: @weight
assert_response :success
end
test "should get edit" do
get :edit, id: @weight
assert_response :success
end
test "should update weight" do
patch :update, id: @weight, weight: { max: @weight.max }
assert_redirected_to weight_path(assigns(:weight))
end
test "should destroy weight" do
assert_difference('Weight.count', -1) do
delete :destroy, id: @weight
end
assert_redirected_to weights_path
end
test "the truth" do
assert true
end
end

View File

@@ -1,49 +1,11 @@
require 'test_helper'
class WrestlersControllerTest < ActionController::TestCase
setup do
@wrestler = wrestlers(:one)
end
# setup do
# @wrestler = wrestlers(:one)
# end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:wrestlers)
end
test "should get new" do
get :new
assert_response :success
end
test "should create wrestler" do
assert_difference('Wrestler.count') do
post :create, wrestler: { name: @wrestler.name, original_seed: @wrestler.original_seed, school_id: @wrestler.school_id, seed: @wrestler.seed, weight_id: @wrestler.weight_id }
end
assert_redirected_to wrestler_path(assigns(:wrestler))
end
test "should show wrestler" do
get :show, id: @wrestler
assert_response :success
end
test "should get edit" do
get :edit, id: @wrestler
assert_response :success
end
test "should update wrestler" do
patch :update, id: @wrestler, wrestler: { name: @wrestler.name, original_seed: @wrestler.original_seed, school_id: @wrestler.school_id, seed: @wrestler.seed, weight_id: @wrestler.weight_id }
assert_redirected_to wrestler_path(assigns(:wrestler))
end
test "should destroy wrestler" do
assert_difference('Wrestler.count', -1) do
delete :destroy, id: @wrestler
end
assert_redirected_to wrestlers_path
end
test "the truth" do
assert true
end
end