Skip to content
Snippets Groups Projects
Commit 66c80712 authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

adding new validations and new tests to languages model


Signed-off-by: default avatarman13 <man13@inf.ufpr.br>
parent 380f680c
No related branches found
No related tags found
No related merge requests found
class Language < ActiveRecord::Base
has_many :learning_object
has_many :learning_objects
validates_uniqueness_of :code
validates_presence_of :name, :code
end
require 'test_helper'
class LanguageTest < ActiveSupport::TestCase
should have_many :learning_objects
should validate_presence_of(:name)
should validate_presence_of(:code)
should validate_uniqueness_of(:code)
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