Sha256: 61fe81266ba6b985f8ccfe373fa5b5ee89a4650f140e992f9af6c81d2e43212d
Contents?: true
Size: 1.21 KB
Versions: 26
Compression:
Stored size: 1.21 KB
Contents
require File.join(File.dirname(__FILE__), 'test_helper') require 'workflow' class WithoutWorkflowTest < Test::Unit::TestCase class Article include Workflow workflow do state :new do event :submit, :transitions_to => :awaiting_review end state :awaiting_review do event :review, :transitions_to => :being_reviewed end state :being_reviewed do event :accept, :transitions_to => :accepted event :reject, :transitions_to => :rejected end state :accepted state :rejected end end def test_readme_example_article article = Article.new assert article.new? end test 'better error message on transitions_to typo' do assert_raise Workflow::WorkflowDefinitionError do Class.new do include Workflow workflow do state :new do event :event1, :transitionnn => :next # missing transitions_to target end state :next end end end end test 'check transition_to alias' do Class.new do include Workflow workflow do state :new do event :event1, :transition_to => :next end state :next end end end end
Version data entries
26 entries across 26 versions & 6 rubygems