Project has now correct owner and creator. Increased test coverage

This commit is contained in:
Dmitriy Zaporozhets 2013-01-02 19:00:00 +02:00
parent 91995909d9
commit 00a1f5bc2c
15 changed files with 241 additions and 113 deletions

View file

@ -10,35 +10,4 @@ describe User, "Account" do
it { user.can_create_project?.should be_true }
it { user.first_name.should == 'John' }
end
describe 'blocking user' do
let(:user) { create(:user, name: 'John Smith') }
it "should block user" do
user.block
user.blocked.should be_true
end
end
describe 'projects' 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) }
end
describe 'namespaced' do
before do
ActiveRecord::Base.observers.enable(:user_observer)
@user = create :user
@project = create :project, namespace: @user.namespace
end
it { @user.several_namespaces?.should be_false }
it { @user.namespaces.should == [@user.namespace] }
end
end