Sha256: ba4d8da01c2d937c95ccac169faeb3dfa3422651d7031ec86a304d554d602371

Contents?: true

Size: 573 Bytes

Versions: 23

Compression:

Stored size: 573 Bytes

Contents

require 'test_plugin_helper'

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

  describe 'uniqueness' do
    subject do
      HostgroupAnsibleRole.new(
        :hostgroup => FactoryBot.build(:hostgroup),
        :ansible_role => FactoryBot.build(:ansible_role)
      )
    end
    should validate_uniqueness_of(:ansible_role_id).scoped_to(:hostgroup_id)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
foreman_ansible-2.2.14 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.13 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.12 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.11 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.10 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.9 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.8 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.7 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.6 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.5 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.4 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.3 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.2 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.1 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.2.0 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.1.2 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.1.1 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.0.4 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.0.3 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-2.0.2 test/unit/hostgroup_ansible_role_test.rb