Sha256: 25f6d9ceee4aae5b55fd6fe71706c2d7665e3a59047bd69b790cb5d0ff24839f

Contents?: true

Size: 908 Bytes

Versions: 7

Compression:

Stored size: 908 Bytes

Contents

require 'spec_helper'

class Convection::Model::Template::Resource
  describe SNSSubscription do
    let(:template) do
      Convection.template do
        sns_subscription 'MySubscription' do
          endpoint 'failures@example.com'
          protocol 'email'
          topic_arn 'arn:aws:sns:us-west-2:123456789012:example-topic'
        end
      end
    end

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

    it 'sets the Endpoint' do
      expect(subject['Endpoint']).to eq('failures@example.com')
    end

    it 'sets the Protocol' do
      expect(subject['Protocol']).to eq('email')
    end

    it 'sets the TopicArn' do
      expect(subject['TopicArn']).to eq('arn:aws:sns:us-west-2:123456789012:example-topic')
    end

    private

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
convection-2.2.28.pre.beta.2 spec/convection/model/template/resource/aws_sns_subscription_spec.rb
convection-2.2.28.pre.beta.1 spec/convection/model/template/resource/aws_sns_subscription_spec.rb
convection-2.2.27 spec/convection/model/template/resource/aws_sns_subscription_spec.rb
convection-2.2.26 spec/convection/model/template/resource/aws_sns_subscription_spec.rb
convection-2.2.25 spec/convection/model/template/resource/aws_sns_subscription_spec.rb
convection-2.2.24 spec/convection/model/template/resource/aws_sns_subscription_spec.rb
convection-2.2.23 spec/convection/model/template/resource/aws_sns_subscription_spec.rb