1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/unit
James Herdman 1b422a537f AASM defines constants for each state name
Example:

  class Foo
    include AASM

    aasm do
      state :initialized
      state :calculated
      state :finalized
    end
  end

  > Foo::STATE_INITIALIZED
  => :initialized
  > Foo::STATE_CALCULATED
  => :calculated

You may find this useful in custom scopes when using ActiveRecord, or
when testing your classes.
2013-03-15 00:07:01 -04:00
..
persistence Using Ruby 1.8 hash syntax 2013-01-08 04:47:58 +09:00
callbacks_spec.rb continued to refactor instance methods for AASM objects 2013-02-22 19:15:03 +13:00
complex_example_spec.rb kiss 2012-12-02 20:55:16 +13:00
event_spec.rb refactored SupportClasses away 2013-02-22 16:02:40 +13:00
initial_state_spec.rb cleaning up specs 2012-12-04 16:27:47 +13:00
inspection_spec.rb added test 2013-02-27 15:13:56 +13:00
localizer_spec.rb refactored SupportClasses away 2013-02-22 16:02:40 +13:00
memory_leak_spec.rb refactored SupportClasses away 2013-02-22 16:02:40 +13:00
new_dsl_spec.rb cleaning up specs 2012-12-04 16:27:47 +13:00
simple_example_spec.rb AASM defines constants for each state name 2013-03-15 00:07:01 -04:00
state_spec.rb refactored SupportClasses away 2013-02-22 16:02:40 +13:00
subclassing_spec.rb refactored tests 2012-12-03 22:54:15 +13:00
transition_spec.rb refactored SupportClasses away 2013-02-22 16:02:40 +13:00