Skip to content
Snippets Groups Projects
Commit adf06a74 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

fix object_type validation

parent ae81ecc2
No related branches found
No related tags found
No related merge requests found
class ObjectType < ActiveRecord::Base
has_many :learning_objects
validates :name, presence: true
validates_presence_of :name
validates_uniqueness_of :name
end
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# This model initially had no columns defined. If you add columns to the
# 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
require 'test_helper'
class Management::ObjectTypeTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class ObjectTypeTest < ActiveSupport::TestCase
should have_many :learning_objects
should validate_presence_of(:name)
should validate_uniqueness_of(:name)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment