Account role spec

This commit is contained in:
Dmitriy Zaporozhets 2012-12-16 18:27:16 +02:00
parent 26afde94fd
commit 592412992d
2 changed files with 48 additions and 12 deletions

View file

@ -66,6 +66,10 @@ describe User do
it { should ensure_length_of(:bio).is_within(0..255) }
end
describe 'modules' do
it { should include_module(Account) }
end
describe "Respond to" do
it { should respond_to(:is_admin?) }
it { should respond_to(:identifier) }
@ -115,16 +119,4 @@ describe User do
user.authentication_token.should_not be_blank
end
end
describe 'projects and namespaces' do
before do
ActiveRecord::Base.observers.enable(:user_observer)
@user = create :user
@project = create :project, namespace: @user.namespace
end
it { @user.authorized_projects.should include(@project) }
it { @user.my_own_projects.should include(@project) }
it { @user.several_namespaces?.should be_false }
end
end