Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tests to several models #372

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions test/models/cohort_assignment_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
require 'test_helper'

class CohortAssignmentTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end

end
12 changes: 9 additions & 3 deletions test/models/cohort_test.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/models/cohortian_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/models/extracurricular_activity_assignment_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 8 additions & 3 deletions test/models/extracurricular_activity_test.rb
Original file line number Diff line number Diff line change
@@ -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
11 changes: 8 additions & 3 deletions test/models/neighborhood_test.rb
Original file line number Diff line number Diff line change
@@ -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