Sha256: 9e423f16e21fed83732393c68f6e910a2a2e826ab22e74f39446b3511364c8df
Contents?: true
Size: 525 Bytes
Versions: 16
Compression:
Stored size: 525 Bytes
Contents
require_relative 'test_helper' class MachineWithValidationsAndCustomAttributeTest < BaseTestCase def setup @model = new_model @machine = StateMachines::Machine.new(@model, :status, :attribute => :state) @machine.state :parked @record = @model.new end def test_should_add_validation_errors_to_custom_attribute @record.state = 'invalid' refute @record.valid? assert_equal ['State is invalid'], @record.errors.full_messages @record.state = 'parked' assert @record.valid? end end
Version data entries
16 entries across 16 versions & 2 rubygems