Sha256: ae5c369d662f61c56774929ff53558fa1e11e33c6cc7301294b54c6d2fe27754

Contents?: true

Size: 952 Bytes

Versions: 18

Compression:

Stored size: 952 Bytes

Contents

# frozen_string_literal: true

require 'test_plugin_helper'

module Helpers
  class JobHelperTest < ActionView::TestCase
    let(:helper) { ::Helpers::JobHelper }

    let(:job_template) do
      FactoryBot.create(:job_template, template: 'echo "1"', job_category: 'leapp',
                                       provider_type: 'SSH', name: 'Leapp preupgrade')
    end
    let(:job_invocation) { FactoryBot.create(:job_invocation) }

    describe 'correct_feature?' do
      setup do
        RemoteExecutionFeature.find_by(label: 'leapp_preupgrade').update(job_template: job_template)
        FactoryBot.create(:template_invocation, template: job_template, job_invocation: job_invocation)
      end

      it 'correct feature' do
        assert helper.correct_feature?(job_invocation, 'leapp_preupgrade')
      end

      it 'wrong feature' do
        assert_not helper.correct_feature?(job_invocation, 'leapp_preupgrade2')
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
foreman_leapp-1.2.1 test/unit/helpers/job_helper_test.rb
foreman_leapp-1.2.0 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.15 test/unit/helpers/job_helper_test.rb
foreman_leapp-1.1.1 test/unit/helpers/job_helper_test.rb
foreman_leapp-1.1.0 test/unit/helpers/job_helper_test.rb
foreman_leapp-1.0.0 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.14 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.13 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.12 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.11 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.10 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.9 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.8 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.7 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.6 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.5 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.4 test/unit/helpers/job_helper_test.rb
foreman_leapp-0.1.3 test/unit/helpers/job_helper_test.rb