Sha256: da2dd00bc15048ad4ca3a78392687b6a25abb654b99b3a75333ae96041caf30f
Contents?: true
Size: 613 Bytes
Versions: 19
Compression:
Stored size: 613 Bytes
Contents
require_relative 'test_helper' class MachineErrorsTest < BaseTestCase def setup @model = new_model { include ActiveModel::Validations } @machine = StateMachines::Machine.new(@model) @record = @model.new end def test_should_be_able_to_describe_current_errors @record.errors.add(:id, 'cannot be blank') @record.errors.add(:state, 'is invalid') assert_equal ['Id cannot be blank', 'State is invalid'], @machine.errors_for(@record).split(', ').sort end def test_should_describe_as_halted_with_no_errors assert_equal 'Transition halted', @machine.errors_for(@record) end end
Version data entries
19 entries across 19 versions & 2 rubygems