Sha256: 0f03b182e69eaeb20d0062d5bb572c7f0ee8f0a7bed66aed2bf1083906df9f69

Contents?: true

Size: 613 Bytes

Versions: 61

Compression:

Stored size: 613 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),
                          :position => 0)
    end
    should validate_uniqueness_of(:ansible_role_id).scoped_to(:host_id)
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
foreman_ansible-14.2.1 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.7 test/unit/host_ansible_role_test.rb
foreman_ansible-14.2.0 test/unit/host_ansible_role_test.rb
foreman_ansible-14.1.1 test/unit/host_ansible_role_test.rb
foreman_ansible-14.1.0 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.5 test/unit/host_ansible_role_test.rb
foreman_ansible-14.0.0 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.4 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.3 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.2 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.1 test/unit/host_ansible_role_test.rb
foreman_ansible-13.0.0 test/unit/host_ansible_role_test.rb
foreman_ansible-12.0.7 test/unit/host_ansible_role_test.rb
foreman_ansible-10.4.4 test/unit/host_ansible_role_test.rb
foreman_ansible-7.1.8 test/unit/host_ansible_role_test.rb
foreman_ansible-12.0.6 test/unit/host_ansible_role_test.rb
foreman_ansible-12.0.5 test/unit/host_ansible_role_test.rb
foreman_ansible-10.4.3 test/unit/host_ansible_role_test.rb
foreman_ansible-12.0.4 test/unit/host_ansible_role_test.rb
foreman_ansible-10.4.2 test/unit/host_ansible_role_test.rb