Sha256: b49a28b14d1170a5c628beec3507eb43e67440640e118c63e474774d71a41cce

Contents?: true

Size: 977 Bytes

Versions: 2

Compression:

Stored size: 977 Bytes

Contents

require 'spec_helper'

describe AwsAlertMonitor::Events::AutoScalingNotification do

  let(:message) { fixture_file('asg_instance_launch.json') }
  let(:event) { AwsAlertMonitor::Events::AutoScalingNotification.new message }

  describe 'body' do
    it 'returns the body' do
      data = "received an alert: \n\n "
      data << "Launching a new EC2 instance: i-d6a2cb8f \n\n "
      data << "At 2012-11-29T16:39:05Z an instance was started in response to a"
      data << " difference between desired and actual capacity,"
      data << " increasing the capacity from 0 to 1."
      event.body.should == data
    end
  end

  describe 'subject' do
    it 'returns the subject' do
      data = 'Alert: Auto Scaling: launch for group '
      data << '"lc-pod-2-qa-1-app-1-Instances-XCYGCEQC0H02"'
      event.subject.should == data
    end
  end

  describe 'type' do
    it 'returns the type' do
      event.type.should == 'autoscaling:EC2_INSTANCE_LAUNCH'
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aws-alert-monitor-0.1.0 spec/events/auto_scaling_notification_spec.rb
aws-alert-monitor-0.0.5 spec/events/auto_scaling_notification_spec.rb