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-0.4.1 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.4.0 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.3.3.pre.beta.1 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.3.2 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.3.1 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.3.0 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.2.34.pre.beta.1 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb
convection-0.2.33 spec/convection/model/template/resource/elasticache_security_group_ingress_spec.rb