File: integration_test.rb

package info (click to toggle)
ruby-state-machines-activemodel 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 276 kB
  • sloc: ruby: 860; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require_relative 'test_helper'

class IntegrationTest < BaseTestCase
  def test_should_be_registered
    assert_includes StateMachines::Integrations.list, StateMachines::Integrations::ActiveModel
  end

  def test_should_register_one_integration
    assert_equal 1, StateMachines::Integrations.list.size
  end

  def test_should_have_an_integration_name
    assert_equal :active_model, StateMachines::Integrations::ActiveModel.integration_name
  end

  def test_should_match_if_class_includes_validations_feature
    assert StateMachines::Integrations::ActiveModel.matches?(new_model { include ActiveModel::Validations })
  end

  def test_should_not_match_if_class_does_not_include_active_model_features
    refute StateMachines::Integrations::ActiveModel.matches?(new_model)
  end

  def test_should_have_no_defaults
    assert_equal({}, StateMachines::Integrations::ActiveModel.defaults)
  end
end