Sha256: fe7716e81f2a3eca0d3f3d5917fa93a596fc000a032b5c4a99dd7d28e553f343

Contents?: true

Size: 576 Bytes

Versions: 23

Compression:

Stored size: 576 Bytes

Contents

require 'test_plugin_helper'
# unit tests for RolesImporter
class RolesImporterTest < ActiveSupport::TestCase
  setup do
    @role = FactoryBot.create(:ansible_role)
    @importer = ForemanAnsible::RolesImporter.new
  end

  test 'should detect changes when importing roles' do
    role = FactoryBot.build(:ansible_role)
    changes = @importer.detect_changes [role]
    assert_equal 1, changes[:new].length
    assert_equal 1, changes[:obsolete].length
    assert_equal role.name, changes[:new].first.name
    assert_equal @role.name, changes[:obsolete].first.name
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

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