Sha256: dbacb5c5421f5da808a8f27c8ccb5ed4141f241af9f64016e76037f9c01ef36e

Contents?: true

Size: 1.94 KB

Versions: 1

Compression:

Stored size: 1.94 KB

Contents

require 'spec_helper'

describe MWS::Connection do

  let(:subject) {MWS::Connection.new({
    aws_access_key_id: "access key",
    aws_secret_access_key: "secret key",
    seller_id: "seller id"
  })}

  it "should have a default host" do
    subject.host.should eq("mws.amazonservices.com")
  end

  describe "call the right apis" do
    it "should return Feeds when calling .feeds" do
      subject.feeds.instance_of?(MWS::API::Feeds).should == true
    end

    it "should return FulfillmentInboundShipment when calling .fulfillment_inbound_shipment" do
      subject.fulfillment_inbound_shipment.instance_of?(MWS::API::FulfillmentInboundShipment).should == true
    end

    it "should return FulfillmentInventory when calling .fulfillment_inventory" do
      subject.fulfillment_inventory.instance_of?(MWS::API::FulfillmentInventory).should == true
    end

    it "should return FulfillmentOutboundShipment when calling .fulfillment_outbound_shipment" do
      subject.fulfillment_outbound_shipment.instance_of?(MWS::API::FulfillmentOutboundShipment).should == true
    end

    it "should return Orders when calling .orders" do
      subject.orders.instance_of?(MWS::API::Orders).should == true
    end

    it "should return Products when calling .products" do
      subject.products.instance_of?(MWS::API::Products).should == true
    end

    it "should return Recommendations when calling .recommendations" do
      subject.recommendations.instance_of?(MWS::API::Recommendations).should == true
    end

    it "should return Reports when calling .reports" do
      subject.reports.instance_of?(MWS::API::Reports).should == true
    end

    it "should return Sellers when calling .sellers" do
      subject.sellers.instance_of?(MWS::API::Sellers).should == true
    end
  end

  describe "Validations" do
    it "should raise argument error if key, secret or seller_id is not provided" do
      expect {MWS::Connection.new}.to raise_error(ArgumentError)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mws-rb-0.0.1 spec/mws-rb/connection_spec.rb