Sha256: cfac25847fc49800a71ee4d88458caa4fd463e8577758dfdb5c22f0a0aab69c8

Contents?: true

Size: 1.16 KB

Versions: 96

Compression:

Stored size: 1.16 KB

Contents

require 'test_plugin_helper'

class TailoringFileTest < ActiveSupport::TestCase
  setup do
    @scap_file = File.new("#{ForemanOpenscap::Engine.root}/test/files/tailoring_files/ssg-firefox-ds-tailoring.xml", 'rb').read
  end

  test 'should create tailoring file' do
    tailoring_file = ForemanOpenscap::TailoringFile.create(:name => 'test_file', :scap_file => @scap_file, :original_filename => 'original name')
    assert tailoring_file.valid?
  end

  test 'should not create tailoring_file without scap file' do
    tailoring_file = ForemanOpenscap::TailoringFile.create(:name => 'test_file', :original_filename => 'original name')
    refute tailoring_file.valid?
  end

  test 'should redigist when scap file changed' do
    scap_file = File.new("#{ForemanOpenscap::Engine.root}/test/files/tailoring_files/ssg-firefox-ds-tailoring-2.xml", 'rb').read
    tailoring_file = ForemanOpenscap::TailoringFile.create(:name => 'test_file', :scap_file => @scap_file, :original_filename => 'original name')
    original_digest = tailoring_file.digest
    tailoring_file.scap_file = scap_file
    assert tailoring_file.save
    refute_equal original_digest, tailoring_file.digest
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
foreman_openscap-0.11.1 test/unit/tailoring_file_test.rb
foreman_openscap-0.11.0 test/unit/tailoring_file_test.rb
foreman_openscap-0.10.4 test/unit/tailoring_file_test.rb
foreman_openscap-0.10.3 test/unit/tailoring_file_test.rb
foreman_openscap-0.10.2 test/unit/tailoring_file_test.rb
foreman_openscap-0.10.1 test/unit/tailoring_file_test.rb
foreman_openscap-0.9.3 test/unit/tailoring_file_test.rb
foreman_openscap-0.10.0 test/unit/tailoring_file_test.rb
foreman_openscap-0.7.13 test/unit/tailoring_file_test.rb
foreman_openscap-0.8.6 test/unit/tailoring_file_test.rb
foreman_openscap-0.9.2 test/unit/tailoring_file_test.rb
foreman_openscap-0.9.1 test/unit/tailoring_file_test.rb
foreman_openscap-0.8.5 test/unit/tailoring_file_test.rb
foreman_openscap-0.7.12 test/unit/tailoring_file_test.rb
foreman_openscap-0.9.0 test/unit/tailoring_file_test.rb
foreman_openscap-0.8.4 test/unit/tailoring_file_test.rb
foreman_openscap-0.7.11 test/unit/tailoring_file_test.rb
foreman_openscap-0.7.10 test/unit/tailoring_file_test.rb
foreman_openscap-0.8.3 test/unit/tailoring_file_test.rb
foreman_openscap-0.7.9 test/unit/tailoring_file_test.rb