Sha256: 35f50a00a6fd4c4ddae9dc52e4665491e114c6d8e1b0d1b2f26fb4ad91e80f93

Contents?: true

Size: 571 Bytes

Versions: 39

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true

require 'test_plugin_helper'

# Tests for validators and such of the join model between Host and
# AnsibleRole
class HostAnsibleRoleTest < ActiveSupport::TestCase
  should belong_to(:host)
  should belong_to(:ansible_role)
  should validate_presence_of(:ansible_role_id)

  describe 'uniqueness' do
    subject do
      HostAnsibleRole.new(:host => FactoryBot.build(:host),
                          :ansible_role => FactoryBot.build(:ansible_role))
    end
    should validate_uniqueness_of(:ansible_role_id).scoped_to(:host_id)
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
foreman_ansible-6.2.0 test/unit/host_ansible_role_test.rb
foreman_ansible-6.1.1 test/unit/host_ansible_role_test.rb
foreman_ansible-6.0.2 test/unit/host_ansible_role_test.rb
foreman_ansible-6.1.0 test/unit/host_ansible_role_test.rb
foreman_ansible-6.0.1 test/unit/host_ansible_role_test.rb
foreman_ansible-5.1.3 test/unit/host_ansible_role_test.rb
foreman_ansible-6.0.0 test/unit/host_ansible_role_test.rb
foreman_ansible-5.1.2 test/unit/host_ansible_role_test.rb
foreman_ansible-5.1.1 test/unit/host_ansible_role_test.rb
foreman_ansible-5.1.0 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.3.5 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.3.4 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.3.3 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.3.2 test/unit/host_ansible_role_test.rb
foreman_ansible-5.0.1 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.5 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.3.1 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.4 test/unit/host_ansible_role_test.rb
foreman_ansible-5.0.0 test/unit/host_ansible_role_test.rb
foreman_ansible-4.0.3 test/unit/host_ansible_role_test.rb