-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate the tests for newer Ruby, Rails and new features
- Loading branch information
Showing
3 changed files
with
39 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require File.join(File.dirname(File.dirname(__FILE__)), 'test_helper') | ||
|
||
require 'workflow' | ||
|
||
class ComparableStatesOrder | ||
include Workflow | ||
workflow do | ||
state :submitted do | ||
event :accept, :transitions_to => :accepted, :meta => {:doc_weight => 8} do |reviewer, args| | ||
end | ||
end | ||
state :accepted do | ||
event :ship, :transitions_to => :shipped | ||
end | ||
state :shipped | ||
end | ||
end | ||
|
||
class CompareStatesTest < ActiveRecordTestCase | ||
|
||
test 'compare states' do | ||
o = ComparableStatesOrder.new | ||
o.accept! | ||
assert_equal :accepted, o.current_state.name | ||
assert o.current_state < :shipped | ||
assert o.current_state > :submitted | ||
assert_raise ArgumentError do | ||
o.current_state > :unknown | ||
end | ||
end | ||
|
||
end |