OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/models/principal_spec.rb

28 lines
663 B

require File.dirname(__FILE__) + '/../spec_helper'
describe Principal do
describe "ATTRIBUTES" do
before :each do
end
it { should have_many :principal_roles }
it { should have_many :global_roles }
end
describe "WHEN deleting a principal" do
let(:principal) { Factory.build(:user) }
let(:role) { Factory.build(:global_role) }
before do
Factory.create(:principal_role, :role => role,
:principal => principal)
principal.destroy
end
it { Role.find_by_id(role.id).should == role }
it { PrincipalRole.find_all_by_principal_id(principal.id).should == [] }
end
end