Sha256: 31442a949205ffc8fe7b9db82abb38e04d7d05948978b7496944777cba3fda8a

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'test_helper'

module KatelloForemanEngine
  module Actions
    class EnvCreateTest < ActiveSupport::TestCase

      test "runs both for library and non-library envs " do
        org = Organization.new(:label => 'org')
        env = KTEnvironment.new(:label => 'dev')
        env.organization = org

        env.library = false
        step = run_steps(EnvironmentCreate, {}, env).first
        assert_equal EnvironmentCreate, step.action_class
        assert_equal 'org', step.input['org_label']
        assert_equal 'dev', step.input['label']
        assert_equal 'env', step.input['content_view_id']

        env.library = true
        step = run_steps(EnvironmentCreate, {}, env).first
        assert_equal EnvironmentCreate, step.action_class
        assert_equal 'org', step.input['org_label']
        assert_equal 'dev', step.input['label']
        assert_equal 'env', step.input['content_view_id']
      end

      test 'calls bindings to create environment' do
        Bindings.expects(:environment_create).with('env', 'org', 'dev')
        EnvironmentCreate.new('org_label' => 'org', 'label' => 'dev', 'content_view_id' => 'env').run
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
katello-foreman-engine-0.0.7 test/lib/actions/env_create_test.rb
katello-foreman-engine-0.0.6 test/lib/actions/env_create_test.rb