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,4 +1,4 @@
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper'))
|
||||
require 'test_helper'
|
||||
|
||||
class StateTestSubject
|
||||
include ActiveModel::StateMachine
|
||||
|
@ -9,13 +9,13 @@ end
|
|||
|
||||
class StateTest < ActiveModel::TestCase
|
||||
def setup
|
||||
@name = :astate
|
||||
@state_name = :astate
|
||||
@machine = StateTestSubject.state_machine
|
||||
@options = { :crazy_custom_key => 'key', :machine => @machine }
|
||||
end
|
||||
|
||||
def new_state(options={})
|
||||
ActiveModel::StateMachine::State.new(@name, @options.merge(options))
|
||||
ActiveModel::StateMachine::State.new(@state_name, @options.merge(options))
|
||||
end
|
||||
|
||||
test 'sets the name' do
|
||||
|
@ -43,32 +43,30 @@ class StateTest < ActiveModel::TestCase
|
|||
assert_equal new_state, new_state
|
||||
end
|
||||
|
||||
uses_mocha 'state actions' do
|
||||
test 'should send a message to the record for an action if the action is present as a symbol' do
|
||||
state = new_state(:entering => :foo)
|
||||
test 'should send a message to the record for an action if the action is present as a symbol' do
|
||||
state = new_state(:entering => :foo)
|
||||
|
||||
record = stub
|
||||
record.expects(:foo)
|
||||
record = stub
|
||||
record.expects(:foo)
|
||||
|
||||
state.call_action(:entering, record)
|
||||
end
|
||||
|
||||
test 'should send a message to the record for an action if the action is present as a string' do
|
||||
state = new_state(:entering => 'foo')
|
||||
|
||||
record = stub
|
||||
record.expects(:foo)
|
||||
|
||||
state.call_action(:entering, record)
|
||||
end
|
||||
|
||||
test 'should call a proc, passing in the record for an action if the action is present' do
|
||||
state = new_state(:entering => Proc.new {|r| r.foobar})
|
||||
|
||||
record = stub
|
||||
record.expects(:foobar)
|
||||
|
||||
state.call_action(:entering, record)
|
||||
end
|
||||
state.call_action(:entering, record)
|
||||
end
|
||||
end
|
||||
|
||||
test 'should send a message to the record for an action if the action is present as a string' do
|
||||
state = new_state(:entering => 'foo')
|
||||
|
||||
record = stub
|
||||
record.expects(:foo)
|
||||
|
||||
state.call_action(:entering, record)
|
||||
end
|
||||
|
||||
test 'should call a proc, passing in the record for an action if the action is present' do
|
||||
state = new_state(:entering => Proc.new {|r| r.foobar})
|
||||
|
||||
record = stub
|
||||
record.expects(:foobar)
|
||||
|
||||
state.call_action(:entering, record)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue