diff --git a/test/models/cohort_assignment_test.rb b/test/models/cohort_assignment_test.rb index 1c6f210..77d6f45 100644 --- a/test/models/cohort_assignment_test.rb +++ b/test/models/cohort_assignment_test.rb @@ -1,7 +1,5 @@ require 'test_helper' class CohortAssignmentTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + end diff --git a/test/models/cohort_test.rb b/test/models/cohort_test.rb index 9ac2106..457a07c 100644 --- a/test/models/cohort_test.rb +++ b/test/models/cohort_test.rb @@ -1,7 +1,13 @@ require 'test_helper' class CohortTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + # should validate :name, presence: true + # should validate_uniqueness_of :name + # should belong_to :user + # should have_many :cohortians + # should have_many :cohorts, through: :cohortians + test "should not save without name" do + cohort = Cohort.new + assert_not cohort.save + end end diff --git a/test/models/cohortian_test.rb b/test/models/cohortian_test.rb index d0a0026..e5e6467 100644 --- a/test/models/cohortian_test.rb +++ b/test/models/cohortian_test.rb @@ -1,6 +1,8 @@ require 'test_helper' class CohortianTest < ActiveSupport::TestCase + should belong_to :member + should belong_to :cohort # test "the truth" do # assert true # end diff --git a/test/models/extracurricular_activity_assignment_test.rb b/test/models/extracurricular_activity_assignment_test.rb index 7bd2a3f..447f306 100644 --- a/test/models/extracurricular_activity_assignment_test.rb +++ b/test/models/extracurricular_activity_assignment_test.rb @@ -1,6 +1,9 @@ require 'test_helper' class ExtracurricularActivityAssignmentTest < ActiveSupport::TestCase + should belong_to :member + should belong_to :extracurricular_activity + should belong_to :user # test "the truth" do # assert true # end diff --git a/test/models/extracurricular_activity_test.rb b/test/models/extracurricular_activity_test.rb index c1739be..57394fb 100644 --- a/test/models/extracurricular_activity_test.rb +++ b/test/models/extracurricular_activity_test.rb @@ -1,7 +1,12 @@ require 'test_helper' class ExtracurricularActivityTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test "ExtracurricularActivity should not save without name" do + extracurricular_activity = ExtracurricularActivity.new + assert_not extracurricular_activity.save + end + test "ExtracurricularActivity should save with name" do + extracurricular_activity = ExtracurricularActivity.new(name:"test extracurricular_activity") + assert extracurricular_activity.save + end end diff --git a/test/models/neighborhood_test.rb b/test/models/neighborhood_test.rb index ddee22d..bcc09fa 100644 --- a/test/models/neighborhood_test.rb +++ b/test/models/neighborhood_test.rb @@ -1,7 +1,12 @@ require 'test_helper' class NeighborhoodTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test "Neighborhood should not save with name" do + neighborhood = Neighborhood.new + assert_not neighborhood.save + end + test "Neighborhood should save with name" do + neighborhood = Neighborhood.new(name:"test neighborhood") + assert neighborhood.save + end end