Sha256: 1619ba4d683dde5f79eef1bdb3508b4bdf01af8dd941871911a01c82d756f9e5

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

require 'test_helper'
require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(  
  :adapter  => 'sqlite3',   
  :database => 'test.sqlite3',   
  :timeout => 5000
)


begin
  ActiveRecord::Base.connection.drop_table(:orders)
rescue
  # no such table
end

ActiveRecord::Base.connection.create_table(:orders) do |table|
  table.string(:state, :null => false, :limit => 10, :default => 'open')
end
class Order < ActiveRecord::Base
  include FSM
  define_fsm do 
    states :open, :closed, :delivered
    transition(:deliver, :open, :delivered)
  end
end

ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.logger.level = Logger::DEBUG # change to DEBUG if you want to see something :-)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simplificator-fsm-0.3.3 test/test_helper_ar.rb