Sha256: c54603b597cd7174cd8ef12549bc6742f439eba12b82672b6ddbef32f548003f

Contents?: true

Size: 575 Bytes

Versions: 14

Compression:

Stored size: 575 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 => FactoryGirl.build(:hostgroup),
        :ansible_role => FactoryGirl.build(:ansible_role)
      )
    end
    should validate_uniqueness_of(:ansible_role_id).scoped_to(:hostgroup_id)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
foreman_ansible-1.5.2 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.5.1 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.5.0 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.4.6 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.4.5 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.4.3 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.4.2 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.4.1 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.4.0 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.3.1 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.3.0 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.2.1 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.2 test/unit/hostgroup_ansible_role_test.rb
foreman_ansible-1.1 test/unit/hostgroup_ansible_role_test.rb