Skip to content
Extraits de code Groupes Projets
misc_spec.rb 875 octets
Newer Older
  • Learn to ignore specific revisions
  • Raphael's avatar
    Raphael a validé
    #   Copyright (c) 2010, Diaspora Inc.  This file is
    
    Raphael's avatar
    Raphael a validé
    #   licensed under the Affero General Public License version 3.  See
    #   the COPYRIGHT file.
    
    maxwell's avatar
    maxwell a validé
    require File.dirname(__FILE__) + '/spec_helper'
    
    maxwell's avatar
    maxwell a validé
    describe 'making sure the spec runner works' do
    
      it 'should not delete the database mid-spec' do
        User.count.should == 0
    
    Raphael's avatar
    Raphael a validé
        Factory.create(:user)
    
    maxwell's avatar
    maxwell a validé
        User.count.should == 1
      end
    
    maxwell's avatar
    maxwell a validé
      it 'should make sure the last user no longer exsists' do
        User.count.should == 0
      end
    
    Raphael's avatar
    Raphael a validé
      it 'should factory create a user with a person saved' do
        user = Factory.create(:user)
        loaded_user = User.first(:id => user.id)
        loaded_user.person.owner_id.should == user.id
      end
    
    maxwell's avatar
    maxwell a validé
      describe 'testing a before do block' do
        before do
    
    Raphael's avatar
    Raphael a validé
          Factory.create(:user)
    
    maxwell's avatar
    maxwell a validé
        end
    
    maxwell's avatar
    maxwell a validé
        it 'should have cleaned before the before do block runs' do
          User.count.should == 1
        end
    
    maxwell's avatar
    maxwell a validé
      end
    
    Raphael's avatar
    Raphael a validé
    end