Sha256: ea7e9a80c41f2299aa0bbe9b4a30bb3ca64125bac7a7adeefa576e8d761bb3e6

Contents?: true

Size: 731 Bytes

Versions: 5

Compression:

Stored size: 731 Bytes

Contents

require "helper"

class TestEvent < Test::Unit::TestCase
  def setup
    @state_name = :close_order
    @success = :success_callback
  end

  def new_event
    @event = Transitions::Event.new(nil, @state_name, {:success => @success}) do
      transitions :to => :closed, :from => [:open, :received]
    end
  end

  test "should set the name" do
    assert_equal @state_name, new_event.name
  end

  test "should set the success option" do
    assert_equal @success, new_event.success
  end

  test "should create StateTransitions" do
    Transitions::StateTransition.expects(:new).with(:to => :closed, :from => :open)
    Transitions::StateTransition.expects(:new).with(:to => :closed, :from => :received)
    new_event
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
transitions-0.0.12 test/test_event.rb
transitions-0.0.11 test/test_event.rb
transitions-0.0.10 test/test_event.rb
transitions-0.0.9 test/test_event.rb
transitions-0.0.5 test/test_event.rb