Sha256: 92fcc51b13f2de33cbf4f6070f416ed068223a5ce249ced912e574dfe1936b31

Contents?: true

Size: 1.78 KB

Versions: 20

Compression:

Stored size: 1.78 KB

Contents

require File.dirname(__FILE__) + '/../../../spec_helper'

describe 'EC2.describe_security_groups' do
  describe 'success' do

    before(:each) do
      ec2.create_security_group('fog_security_group', 'a security group for testing fog')
    end

    after(:each) do
      ec2.delete_security_group('fog_security_group')
    end

    it "should return proper attributes with no params" do
      actual = ec2.describe_security_groups
      actual.body['requestId'].should be_a(String)
      actual.body['securityGroupInfo'].should be_an(Array)
      security_group = actual.body['securityGroupInfo'].select do |security_group| 
        security_group['groupName'] == 'fog_security_group'
      end.first
      security_group['groupDescription'].should be_a(String)
      security_group['groupName'].should be_a(String)
      security_group['ownerId'].should be_a(String)
      security_group['ipPermissions'].should be_an(Array)

    end

    it "should return proper attributes with params" do
      actual = ec2.describe_security_groups('fog_security_group')
      actual.body['requestId'].should be_a(String)
      actual.body['securityGroupInfo'].should be_an(Array)
      security_group = actual.body['securityGroupInfo'].select do |security_group| 
        security_group['groupName'] == 'fog_security_group'
      end.first
      security_group['groupDescription'].should be_a(String)
      security_group['groupName'].should be_a(String)
      security_group['ownerId'].should be_a(String)
      security_group['ipPermissions'].should be_an(Array)
    end

  end
  describe 'failure' do

    it "should raise a BadRequest error if the security group does not exist" do
      lambda {
        ec2.describe_security_groups('not_a_security_group')
      }.should raise_error(Fog::Errors::BadRequest)
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fog-0.0.29 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.28 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.27 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.26 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.25 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.24 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.23 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.22 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.21 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.20 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.19 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.18 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.17 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.16 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.15 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.14 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.13 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.12 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.11 spec/aws/requests/ec2/describe_security_groups_spec.rb
fog-0.0.10 spec/aws/requests/ec2/describe_security_groups_spec.rb