Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release. Among other improvements, this means that it now automagically selects between WEBrick and Mongrel. Just run ./instiki --daemon
This commit is contained in:
parent
43aadecc99
commit
4e14ccc74d
893 changed files with 71965 additions and 28511 deletions
|
@ -1,31 +1,29 @@
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
|
||||
require 'test_helper'
|
||||
|
||||
class EventTest < ActiveModel::TestCase
|
||||
def setup
|
||||
@name = :close_order
|
||||
@state_name = :close_order
|
||||
@success = :success_callback
|
||||
end
|
||||
|
||||
def new_event
|
||||
@event = ActiveModel::StateMachine::Event.new(nil, @name, {:success => @success}) do
|
||||
@event = ActiveModel::StateMachine::Event.new(nil, @state_name, {:success => @success}) do
|
||||
transitions :to => :closed, :from => [:open, :received]
|
||||
end
|
||||
end
|
||||
|
||||
test 'should set the name' do
|
||||
assert_equal @name, new_event.name
|
||||
assert_equal @state_name, new_event.name
|
||||
end
|
||||
|
||||
test 'should set the success option' do
|
||||
assert_equal @success, new_event.success
|
||||
end
|
||||
|
||||
uses_mocha 'StateTransition creation' do
|
||||
test 'should create StateTransitions' do
|
||||
ActiveModel::StateMachine::StateTransition.expects(:new).with(:to => :closed, :from => :open)
|
||||
ActiveModel::StateMachine::StateTransition.expects(:new).with(:to => :closed, :from => :received)
|
||||
new_event
|
||||
end
|
||||
test 'should create StateTransitions' do
|
||||
ActiveModel::StateMachine::StateTransition.expects(:new).with(:to => :closed, :from => :open)
|
||||
ActiveModel::StateMachine::StateTransition.expects(:new).with(:to => :closed, :from => :received)
|
||||
new_event
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue