mirror of
				https://github.com/aasm/aasm
				synced 2023-03-27 23:22:41 -04:00 
			
		
		
		
	cleaned up the specs
This commit is contained in:
		
							parent
							
								
									31258e7636
								
							
						
					
					
						commit
						766e985158
					
				
					 5 changed files with 5 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,3 @@
 | 
			
		|||
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'aasm')
 | 
			
		||||
 | 
			
		||||
class Conversation
 | 
			
		||||
  include AASM
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
Dir[File.dirname(__FILE__) + "/models/**/*.rb"].each { |f| require File.expand_path(f) }
 | 
			
		||||
Dir[File.dirname(__FILE__) + "/../models/*.rb"].each { |f| require File.expand_path(f) }
 | 
			
		||||
 | 
			
		||||
class Foo
 | 
			
		||||
  include AASM
 | 
			
		||||
| 
						 | 
				
			
			@ -1,8 +1,7 @@
 | 
			
		|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 | 
			
		||||
require File.expand_path(File.join(File.dirname(__FILE__), 'conversation'))
 | 
			
		||||
 | 
			
		||||
describe Conversation, 'description' do
 | 
			
		||||
  it '.aasm_states should contain all of the states' do
 | 
			
		||||
describe 'aasm_states' do
 | 
			
		||||
  it 'should contain all of the states' do
 | 
			
		||||
    Conversation.aasm_states.should == [:needs_attention, :read, :closed, :awaiting_response, :junk]
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ describe "state machines" do
 | 
			
		|||
    event_count = number_of_objects(AASM::SupportingClasses::Event)
 | 
			
		||||
    transition_count = number_of_objects(AASM::SupportingClasses::StateTransition)
 | 
			
		||||
 | 
			
		||||
    load File.expand_path(File.dirname(__FILE__) + '/../models/process.rb')
 | 
			
		||||
    load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb')
 | 
			
		||||
    machines.size.should == machines_count + 1                                                  # + Process
 | 
			
		||||
    number_of_objects(Models::Process).should == 0
 | 
			
		||||
    number_of_objects(AASM::SupportingClasses::State).should == state_count + 3                 # + Process
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +24,7 @@ describe "state machines" do
 | 
			
		|||
    number_of_objects(AASM::SupportingClasses::StateTransition).should == transition_count + 2  # + Process
 | 
			
		||||
 | 
			
		||||
    Models.send(:remove_const, "Process") if Models.const_defined?("Process")
 | 
			
		||||
    load File.expand_path(File.dirname(__FILE__) + '/../models/process.rb')
 | 
			
		||||
    load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb')
 | 
			
		||||
    machines.size.should == machines_count + 1                                                  # + Process
 | 
			
		||||
    number_of_objects(AASM::SupportingClasses::State).should == state_count + 3                 # + Process
 | 
			
		||||
    number_of_objects(AASM::SupportingClasses::Event).should == event_count + 2                 # + Process
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue