Skip to content
Extraits de code Groupes Projets
misc_spec.rb 553 octets
Newer Older
  • Learn to ignore specific revisions
  • maxwell's avatar
    maxwell a validé
    require File.dirname(__FILE__) + '/spec_helper'
     
    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
      
      it 'should make sure the last user no longer exsists' do
        User.count.should == 0
      end
      
      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
        
        it 'should have cleaned before the before do block runs' do
          User.count.should == 1
        end
        
      end
    
    Raphael's avatar
    Raphael a validé
    end