Sha256: 9d7540856d83d30940bd035b3d6e7de34fe1cec58c8f5ce1a0599ff67c408961

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe Rhea::Kubernetes::Commands::Import, :vcr do
  include KubernetesSpecHelper

  before(:each) { delete_replication_controllers }
  after(:each) { delete_replication_controllers }

  describe '#perform' do
    context 'no existing rcs' do
      let(:process_count) { 1 }
      let(:data) do
        {
          version: Rhea::VERSION,
          created_at: Time.now,
          commands: [
            {
              expression: command_expression,
              image: kube_image,
              process_count: process_count
            }.stringify_keys
          ]
        }.stringify_keys
      end

      it 'creates the rcs' do
        described_class.new(data).perform
        replication_controllers = Rhea::Kubernetes::Commands::All.new.perform
        expected_attributes = {
          expression: command_expression,
          image: kube_image,
          process_count: process_count
        }
        expect(replication_controllers.length).to eq(1)
        expect(replication_controllers[0].attributes).to include(expected_attributes)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rhea-0.2.0 spec/lib/rhea/kubernetes/commands/import_spec.rb
rhea-0.1.0 spec/lib/rhea/kubernetes/commands/import_spec.rb