Sha256: e81ae9bc0735f65cad404bb7925de772a03d4eafd52b07c4554a76a54d907ce4

Contents?: true

Size: 739 Bytes

Versions: 2

Compression:

Stored size: 739 Bytes

Contents

require 'test_helper'
require 'simple_aws/iam'

describe SimpleAWS::IAM do

  before do
    @api = SimpleAWS::IAM.new "key", "secret"
  end

  it "points to the endpoint" do
    @api.uri.must_equal "https://iam.amazonaws.com"
  end

  it "works with the current version" do
    @api.version.must_equal "2010-05-08"
  end

  describe "API calls" do

    it "builds and signs calls with ActionParam rules" do
      SimpleAWS::Connection.any_instance.expects(:call).with do |request|
        params = request.params
        params.wont_be_nil

        params["Action"].must_equal "GetGroup"
        params["Signature"].wont_be_nil

        true
      end

      obj = SimpleAWS::IAM.new "key", "secret"
      obj.get_group
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_aws-1.2.0 test/simple_aws/iam_test.rb
simple_aws-1.1.0 test/simple_aws/iam_test.rb