1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Model validations

This commit is contained in:
2015-12-30 19:04:41 +00:00
parent c82d6d727b
commit 198c6d5e82
10 changed files with 34 additions and 3 deletions

View File

@@ -4,4 +4,10 @@ class MatTest < ActiveSupport::TestCase
test "the truth" do
assert true
end
test "Mat validations" do
mat = Mat.new
assert_not mat.valid?
assert_equal [:name], mat.errors.keys
end
end

View File

@@ -4,4 +4,10 @@ class SchoolTest < ActiveSupport::TestCase
test "the truth" do
assert true
end
test "School validations" do
school = School.new
assert_not school.valid?
assert_equal [:name], school.errors.keys
end
end

View File

@@ -5,9 +5,9 @@ class TournamentTest < ActiveSupport::TestCase
assert true
end
test "Tournament needs a date" do
test "Tournament validations" do
tourney = Tournament.new
assert_not tourney.valid?
assert_equal [:date], tourney.errors.keys
assert_equal [:date, :name, :tournament_type, :address, :director, :director_email], tourney.errors.keys
end
end

View File

@@ -4,4 +4,10 @@ class WeightTest < ActiveSupport::TestCase
test "the truth" do
assert true
end
test "Weight validations" do
weight = Weight.new
assert_not weight.valid?
assert_equal [:max], weight.errors.keys
end
end

View File

@@ -4,4 +4,10 @@ class WrestlerTest < ActiveSupport::TestCase
test "the truth" do
assert true
end
test "Wrestler validations" do
wrestler = Wrestler.new
assert_not wrestler.valid?
assert_equal [:name, :weight_id, :school_id], wrestler.errors.keys
end
end