category_test.rb revision e4561ce155a76b750b373f3b261970133756e6ca
require 'test_helper'
context 'Migrations' do
end
context 'Validations' do
setup do
end
should 'trigger when identical node is created' do
assert_raise(ActiveRecord::RecordInvalid) { FactoryGirl.create :category, name: 'node1', parent: Category.find_by_name('root') }
end
end
assert_nothing_raised { FactoryGirl.create :category, name: 'node2', parent: Category.find_by_name('root') }
end
end
setup do
@ontology.entities.push(FactoryGirl.create :entity, :kind => 'Class', :name => "Business_and_administration")
@ontology.entities.push(FactoryGirl.create :entity, :kind => 'Class', :name => "Accounting_and_taxation")
end
end
assert Category.find_by_name("Accounting_and_taxation").parent == Category.find_by_name("Business_and_administration")
end
setup do
@ontology.logic.name = "CASL"
end
end
end
end
end