Sha256: 3b9d10fd915f9c24e2340b8cc2d731c65a2842d7e230cb31243755f350bb6949

Contents?: true

Size: 1.32 KB

Versions: 68

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

class Convection::Model::Template::Resource
  describe ElastiCacheCluster do
    let(:template) do
      Convection.template do
        description 'Elasticache Test Template'

        elasticache_cache_cluster 'MyRedisCluster' do
          cluster_name 'RedisCluster007'

          auto_minor_version_upgrade true
          cache_node_type 'cache.m3.medium'

          # NOTE: We do not have to actually be able to resolve these
          # function references for unit testing.
          cache_parameter_group_name fn_ref('MyRedisParmGroup')
          cache_security_group_names [fn_ref('MyRedisSecGroup')]

          engine 'redis'
          engine_version '2.8.6'
          num_cache_nodes 1
        end
      end
    end

    subject do
      template_json
        .fetch('Resources')
        .fetch('MyRedisCluster')
        .fetch('Properties')
    end

    it 'references the specified security group names' do
      expect(subject['CacheSecurityGroupNames']).to include('Ref' => 'MyRedisSecGroup')
    end

    it 'specifies the cluster name RedisCluster007' do
      expect(subject['ClusterName']).to eq('RedisCluster007')
    end

    it 'specifies the engine redis' do
      expect(subject['Engine']).to eq('redis')
    end

    private

    def template_json
      JSON.parse(template.to_json)
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
convection-0.4.1 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.4.0 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.3.3.pre.beta.1 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.3.2 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.3.1 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.3.0 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.2.34.pre.beta.1 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-0.2.33 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb