Sha256: eb884e25eebe5e2d008faf76f3e145e9bc336384cf1d9c609e6090952bb28ee2

Contents?: true

Size: 917 Bytes

Versions: 1

Compression:

Stored size: 917 Bytes

Contents

require 'test_helper'
require 'simple_aws/ses'

describe SimpleAWS::SES do

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

  it "only works on one endpoint" do
    lambda {
      SimpleAWS::SES.new "key", "secret", "us-west-1"
    }.must_raise ArgumentError
  end

  it "points to the endpoint" do
    @api.uri.must_equal "https://email.us-east-1.amazonaws.com"
  end

  it "works with the current version" do
    @api.version.must_equal "2010-12-01"
  end

  describe "API calls" do

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

        params["Action"].must_equal "SendEmail"
        request.headers["X-Amzn-Authorization"].wont_be_nil

        true
      end

      obj = SimpleAWS::SES.new "key", "secret"
      obj.send_email
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_aws-1.1.0 test/simple_aws/ses.rb