Sha256: cac08d52a7573512cfbd32eaef2d5e2904dbb0eb14c09ba3ff37dfc16287cb79

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "StateMachineMongoid integration" do
  before(:all) do
    Mongoid.configure do |config|
      name = "state_machine-mongoid"
      host = "localhost"
      config.allow_dynamic_fields = false
      config.master = Mongo::Connection.new.db(name)
    end
  end
  
  context "new vehicle" do
    before(:each) do
      @vehicle = Vehicle.new
    end
    
    it "should be parked" do
      @vehicle.parked?.should be_true
      @vehicle.state.should == "parked"
    end
    
    context "after igniting" do
      before(:each) do
        @vehicle.ignite
      end
      
      it "should be ignited" do
        @vehicle.idling?.should be_true
      end
    end
    
    
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
state_machine-mongoid-0.1.1 spec/state_machine-mongoid_spec.rb