1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +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

@@ -113,7 +113,7 @@ GEM
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.5)
rails-dom-testing (1.0.6)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)

View File

@@ -88,7 +88,7 @@ class Weight < ActiveRecord::Base
end
def pool_bracket_type
if self.wrestlers.size > 7 && self.wrestlers.size <= 8
if self.wrestlers.size > 6 && self.wrestlers.size <= 8
return "twoPoolsToSemi"
elsif self.wrestlers.size > 8 && self.wrestlers.size <= 10
return "twoPoolsToFinal"

View File

@@ -13,7 +13,7 @@ Wrestling::Application.configure do
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching.
@@ -33,4 +33,6 @@ Wrestling::Application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
config.active_support.test_order = :random
end

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

View File

@@ -1,19 +1,19 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
r_id: 1
g_id: 1
g_stat: MyText
r_stat: MyText
winner_id: 1
win_type: MyString
score: MyString
# one:
# r_id: 1
# g_id: 1
# g_stat: MyText
# r_stat: MyText
# winner_id: 1
# win_type: MyString
# score: MyString
two:
r_id: 1
g_id: 1
g_stat: MyText
r_stat: MyText
winner_id: 1
win_type: MyString
score: MyString
# two:
# r_id: 1
# g_id: 1
# g_stat: MyText
# r_stat: MyText
# winner_id: 1
# win_type: MyString
# score: MyString

View File

@@ -1,9 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
tournament_id: 1
# one:
# name: MyString
# tournament_id: 1
two:
name: MyString
tournament_id: 1
# two:
# name: MyString
# tournament_id: 1

View File

@@ -1,9 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
score: 1
id: 1
name: Central Crossing
tournament_id: 1
two:
name: MyString
score: 1
id: 2
name: Grove City
tournament_id: 1

View File

@@ -1,13 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
address: MyString
director: MyString
director_email: MyString
id: 1
name: Comet Classic
address: Some Place
director: Jacob Cody Wimer
director_email: jacob.wimer@gmail.com
matchups_array:
two:
name: MyString
address: MyString
director: MyString
director_email: MyString

View File

@@ -4,8 +4,8 @@
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
# one: {}
# # column: value
# #
# two: {}
# # column: value

View File

@@ -1,7 +1,30 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
max: 1
id: 1
max: 106
tournament_id: 1
two:
max: 1
id: 2
max: 120
tournament_id: 1
three:
id: 3
max: 113
tournament_id: 1
four:
id: 4
max: 126
tournament_id: 1
five:
id: 5
max: 132
tournament_id: 1

View File

@@ -1,15 +1,397 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
name: Zach Collins
school_id: 1
weight_id: 1
seed: 1
original_seed: 1
original_seed: 4
season_loss: 8
season_win: 30
criteria: DP 5th
two:
name: MyString
name: Jaden Mattox
school_id: 1
weight_id: 1
seed: 1
original_seed: 1
season_loss: 3
season_win: 49
criteria: SP 2nd
three:
name: Jackson Lakso
school_id: 1
weight_id: 1
original_seed: 3
season_loss: 8
season_win: 30
criteria: SQ
four:
name: JD Woods
school_id: 1
weight_id: 1
original_seed: 5
season_loss: 12
season_win: 30
criteria: DP 6th
five:
name: James Wimer
school_id: 1
weight_id: 1
original_seed: 2
season_loss: 12
season_win: 49
criteria: SP 5th
six:
name: Derek Wurzauf
school_id: 1
weight_id: 2
original_seed: 6
season_loss: 15
season_win: 16
criteria:
seven:
name: Casey Davis
school_id: 1
weight_id: 2
original_seed: 5
season_loss: 15
season_win: 16
criteria: DQ
eight:
name: Ethan Leapley
school_id: 1
weight_id: 2
original_seed: 4
season_loss: 15
season_win: 20
criteria: DP 6th
nine:
name: Clayton Ray
school_id: 1
weight_id: 2
original_seed: 1
season_loss: 4
season_win: 30
criteria: SP 7th
ten:
name: Robbie Fusner
school_id: 1
weight_id: 2
original_seed: 3
season_loss: 5
season_win: 40
criteria: SQ
eleven:
name: Kameron Teacher
school_id: 1
weight_id: 2
original_seed: 2
season_loss: 2
season_win: 50
criteria: SQ
twelve:
name: Guy1
school_id: 1
weight_id: 2
original_seed: 7
season_loss: 2
season_win: 50
criteria:
thirteen:
name: Guy2
school_id: 1
weight_id: 3
original_seed: 1
season_loss: 2
season_win: 50
criteria:
fourteen:
name: Guy3
school_id: 1
weight_id: 3
original_seed: 2
season_loss: 2
season_win: 50
criteria:
fifteen:
name: Guy4
school_id: 1
weight_id: 3
original_seed: 3
season_loss: 2
season_win: 50
criteria:
sixteen:
name: Guy5
school_id: 1
weight_id: 3
original_seed: 4
season_loss: 2
season_win: 50
criteria:
seventeen:
name: Guy6
school_id: 1
weight_id: 3
original_seed: 5
season_loss: 2
season_win: 50
criteria:
eighteen:
name: Guy7
school_id: 1
weight_id: 3
original_seed: 6
season_loss: 2
season_win: 50
criteria:
ninteen:
name: Guy8
school_id: 1
weight_id: 3
original_seed: 7
season_loss: 2
season_win: 50
criteria:
twenty:
name: Guy9
school_id: 1
weight_id: 3
original_seed: 8
season_loss: 2
season_win: 50
criteria:
twentyone:
name: Guy10
school_id: 1
weight_id: 3
original_seed: 9
season_loss: 2
season_win: 50
criteria:
twentytwo:
name: Guy11
school_id: 1
weight_id: 4
original_seed: 1
season_loss: 2
season_win: 50
criteria:
twentythree:
name: Guy12
school_id: 1
weight_id: 4
original_seed: 2
season_loss: 2
season_win: 50
criteria:
twentyfour:
name: Guy13
school_id: 1
weight_id: 4
original_seed: 3
season_loss: 2
season_win: 50
criteria:
twentyfive:
name: Guy14
school_id: 1
weight_id: 4
original_seed: 4
season_loss: 2
season_win: 50
criteria:
twentysix:
name: Guy15
school_id: 1
weight_id: 4
original_seed: 5
season_loss: 2
season_win: 50
criteria:
twnetyseven:
name: Guy16
school_id: 1
weight_id: 4
original_seed: 6
season_loss: 2
season_win: 50
criteria:
twentyeight:
name: Guy17
school_id: 1
weight_id: 4
original_seed: 7
season_loss: 2
season_win: 50
criteria:
twentynine:
name: Guy18
school_id: 1
weight_id: 4
original_seed: 8
season_loss: 2
season_win: 50
criteria:
thirty:
name: Guy19
school_id: 1
weight_id: 4
original_seed: 9
season_loss: 2
season_win: 50
criteria:
thrityone:
name: Guy20
school_id: 1
weight_id: 4
original_seed: 10
season_loss: 2
season_win: 50
criteria:
thirtytwo:
name: Guy21
school_id: 1
weight_id: 4
original_seed: 11
season_loss: 2
season_win: 50
criteria:
thirtythree:
name: Guy22
school_id: 1
weight_id: 5
original_seed: 1
season_loss: 2
season_win: 50
criteria:
thirtyfour:
name: Guy23
school_id: 1
weight_id: 5
original_seed: 2
season_loss: 2
season_win: 50
criteria:
thirtyfive:
name: Guy24
school_id: 1
weight_id: 5
original_seed: 3
season_loss: 2
season_win: 50
criteria:
thirtysix:
name: Guy25
school_id: 1
weight_id: 5
original_seed: 4
season_loss: 2
season_win: 50
criteria:
thirtyseven:
name: Guy26
school_id: 1
weight_id: 5
original_seed: 5
season_loss: 2
season_win: 50
criteria:
thirtyeight:
name: Guy27
school_id: 1
weight_id: 5
original_seed: 6
season_loss: 2
season_win: 50
criteria:
thirtynine:
name: Guy28
school_id: 1
weight_id: 5
original_seed: 7
season_loss: 2
season_win: 50
criteria:
fourty:
name: Guy29
school_id: 1
weight_id: 5
original_seed: 8
season_loss: 2
season_win: 50
criteria:
fourtyone:
name: Guy30
school_id: 1
weight_id: 5
original_seed: 9
season_loss: 2
season_win: 50
criteria:
fourtytwo:
name: Guy31
school_id: 1
weight_id: 5
original_seed: 10
season_loss: 2
season_win: 50
criteria:
fourtythree:
name: Guy32
school_id: 1
weight_id: 5
original_seed: 11
season_loss: 2
season_win: 50
criteria:
fourtyfour:
name: Guy33
school_id: 1
weight_id: 5
original_seed: 12
season_loss: 2
season_win: 50
criteria:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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