Sha256: e0f55599a58606f8961c93a8970621a44758333b54138aa180f9d50b25ee1808

Contents?: true

Size: 1022 Bytes

Versions: 7

Compression:

Stored size: 1022 Bytes

Contents

require_relative 'test_helper'

class IntegrationTest < BaseTestCase
  def test_should_have_an_integration_name
    assert_equal :active_record, StateMachines::Integrations::ActiveRecord.integration_name
  end

  def test_should_be_before_activemodel
    integrations = StateMachines::Integrations.list.to_a
    assert StateMachines::Integrations::ActiveRecord, integrations.first
    assert StateMachines::Integrations::ActiveModel, integrations.last
  end

  def test_should_match_if_class_inherits_from_active_record
    assert StateMachines::Integrations::ActiveRecord.matches?(new_model)
  end

  def test_should_not_match_if_class_does_not_inherit_from_active_record
    refute StateMachines::Integrations::ActiveRecord.matches?(Class.new)
  end

  def test_should_have_defaults
    assert_equal({action: :save, use_transactions: true}, StateMachines::Integrations::ActiveRecord.defaults)
  end

  def test_should_have_a_locale_path
    assert_not_nil StateMachines::Integrations::ActiveRecord.locale_path
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
state_machines-activerecord-0.5.2 test/integration_test.rb
state_machines-activerecord-0.5.1 test/integration_test.rb
state_machines-activerecord-0.5.0 test/integration_test.rb
state_machines-activerecord-0.4.1 test/integration_test.rb
state_machines-activerecord-0.4.0 test/integration_test.rb
state_machines-activerecord-0.4.0.pre test/integration_test.rb
state_machines-activerecord-0.3.0 test/integration_test.rb