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-2.3.1 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.3.0 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.29 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.28.pre.beta.2 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.28.pre.beta.1 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.27 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.26 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.25 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.24 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.23 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.22 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.21 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.20 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.19 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.18 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.17 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.16 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.15 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.14 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb
convection-2.2.13 spec/convection/model/template/resource/elasticache_cache_cluster_spec.rb