team_user_spec.rb revision 6514d548e755dd1067259c3eea6b7c05859a84d1
1117N/A expect(team.team_users.count).to eq(2) 1117N/A expect(team.team_users.admin.first.user).to eq(team_admin) 1117N/A expect(team.team_users.non_admin.first.user).to eq(team_user) 1117N/A expect(non_admim_user.destroy).to be_truthy 1117N/A it 'not destroy the last admin' do 1117N/A expect { admin_user.destroy }. 1117N/A to raise_error(Permission::PowerVaccuumError) 1117N/A it 'not remove the last admin flag' do 1117N/A expect { admin_user.update_attribute :admin, false }. 1117N/A to raise_error(Permission::PowerVaccuumError)