Sha256: e60d616f6643cb3ead92cc8c0098a7511db1575e80030fd1045ff39c92bfa84a

Contents?: true

Size: 1.15 KB

Versions: 68

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

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

        elasticache_security_group_ingress 'MyRedisSecGroupIngress' do
          # NOTE: We do not have to actually be able to resolve these
          # function references for unit testing.
          cache_security_group_name     fn_ref('MyRedisSecGroup')
          ec2_security_group_name       fn_ref('MyEC2SecGroup')
          ec2_security_group_owner_id   '123456789012'
        end
      end
    end

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

    it 'contains a reference to the specified cache security group name' do
      expect(subject['CacheSecurityGroupName']).to eq('Ref' => 'MyRedisSecGroup')
    end

    it 'contains a reference to the specified EC2 security group name' do
      expect(subject['EC2SecurityGroupName']).to eq('Ref' => 'MyEC2SecGroup')
    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_security_group_ingress_spec.rb
convection-2.3.0 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.29 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.28.pre.beta.2 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.28.pre.beta.1 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.27 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.26 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.25 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.24 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.23 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.22 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.21 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.20 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.19 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.18 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.17 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.16 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.15 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.14 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-2.2.13 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb