one file per test model class
This commit is contained in:
parent
ede514b115
commit
461886e394
|
@ -0,0 +1,15 @@
|
||||||
|
class Bar
|
||||||
|
include AASM
|
||||||
|
|
||||||
|
aasm do
|
||||||
|
state :read
|
||||||
|
state :ended
|
||||||
|
|
||||||
|
event :foo do
|
||||||
|
transitions :to => :ended, :from => [:read]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Baz < Bar
|
||||||
|
end
|
|
@ -1,5 +1,3 @@
|
||||||
Dir[File.dirname(__FILE__) + "/../models/*.rb"].sort.each { |f| require File.expand_path(f) }
|
|
||||||
|
|
||||||
class Foo
|
class Foo
|
||||||
include AASM
|
include AASM
|
||||||
aasm do
|
aasm do
|
||||||
|
@ -34,31 +32,3 @@ class FooTwo < Foo
|
||||||
state :foo
|
state :foo
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Bar
|
|
||||||
include AASM
|
|
||||||
|
|
||||||
aasm do
|
|
||||||
state :read
|
|
||||||
state :ended
|
|
||||||
|
|
||||||
event :foo do
|
|
||||||
transitions :to => :ended, :from => [:read]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class Baz < Bar
|
|
||||||
end
|
|
||||||
|
|
||||||
class ThisNameBetterNotBeInUse
|
|
||||||
include AASM
|
|
||||||
|
|
||||||
aasm do
|
|
||||||
state :initial
|
|
||||||
state :symbol
|
|
||||||
state :string
|
|
||||||
state :array
|
|
||||||
state :proc
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
class SimpleMongoid
|
||||||
|
include Mongoid::Document
|
||||||
|
include AASM
|
||||||
|
|
||||||
|
field :status, type: String
|
||||||
|
|
||||||
|
aasm_column :status
|
||||||
|
aasm_state :unknown_scope
|
||||||
|
aasm_state :new
|
||||||
|
end
|
|
@ -1,14 +1,3 @@
|
||||||
class SimpleMongoid
|
|
||||||
include Mongoid::Document
|
|
||||||
include AASM
|
|
||||||
|
|
||||||
field :status, type: String
|
|
||||||
|
|
||||||
aasm_column :status
|
|
||||||
aasm_state :unknown_scope
|
|
||||||
aasm_state :new
|
|
||||||
end
|
|
||||||
|
|
||||||
class SimpleNewDslMongoid
|
class SimpleNewDslMongoid
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include AASM
|
include AASM
|
||||||
|
@ -20,4 +9,4 @@ class SimpleNewDslMongoid
|
||||||
state :unknown_scope
|
state :unknown_scope
|
||||||
state :new
|
state :new
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -0,0 +1,11 @@
|
||||||
|
class ThisNameBetterNotBeInUse
|
||||||
|
include AASM
|
||||||
|
|
||||||
|
aasm do
|
||||||
|
state :initial
|
||||||
|
state :symbol
|
||||||
|
state :string
|
||||||
|
state :array
|
||||||
|
state :proc
|
||||||
|
end
|
||||||
|
end
|
|
@ -15,5 +15,8 @@ def load_schema
|
||||||
load(File.dirname(__FILE__) + "/schema.rb")
|
load(File.dirname(__FILE__) + "/schema.rb")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Requiring custom spec helpers
|
# custom spec helpers
|
||||||
Dir[File.dirname(__FILE__) + "/spec_helpers/**/*.rb"].sort.each { |f| require File.expand_path(f) }
|
Dir[File.dirname(__FILE__) + "/spec_helpers/**/*.rb"].sort.each { |f| require File.expand_path(f) }
|
||||||
|
|
||||||
|
# example model classes
|
||||||
|
Dir[File.dirname(__FILE__) + "/models/*.rb"].sort.each { |f| require File.expand_path(f) }
|
||||||
|
|
|
@ -4,7 +4,7 @@ describe 'mongoid', :if => Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version
|
||||||
require 'mongoid'
|
require 'mongoid'
|
||||||
require 'logger'
|
require 'logger'
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require File.dirname(__FILE__) + '/../../models/mongoid/mongoid_models'
|
Dir[File.dirname(__FILE__) + "/../../models/*.rb"].sort.each { |f| require File.expand_path(f) }
|
||||||
|
|
||||||
# if you want to see the statements while running the spec enable the following line
|
# if you want to see the statements while running the spec enable the following line
|
||||||
# Mongoid.logger = Logger.new(STDERR)
|
# Mongoid.logger = Logger.new(STDERR)
|
||||||
|
@ -123,4 +123,4 @@ describe 'mongoid', :if => Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue