Sha256: 6d3ccc95088ea3025bd8740d50409b3744568b27c1e0ea9f05a79ecf2e08238e

Contents?: true

Size: 967 Bytes

Versions: 1

Compression:

Stored size: 967 Bytes

Contents

require "spec_helper"

module ShipCompliant
  describe ErrorResult do
    let(:error) do
      {
        code: "404",
        key: "OrderId",
        message: "I'm smarter than the average bear, Boo Boo",
        target: "SalesOrder",
        type: "Validation"
      }
    end

    subject { ErrorResult.new(error) }

    context "code" do
      it "returns the code as an integer" do
        expect(subject.code).to eq(404)
      end
    end

    context "key" do
      it "gets the key" do
        expect(subject.key).to eq("OrderId")
      end
    end

    context "message" do
      it "gets the message" do
        expect(subject.message).to eq("I'm smarter than the average bear, Boo Boo")
      end
    end

    context "target" do
      it "gets the target" do
        expect(subject.target).to eq("SalesOrder")
      end
    end

    context "type" do
      it "gets the type" do
        expect(subject.type).to eq("Validation")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ship_compliant-0.2.1 spec/lib/ship_compliant/error_result_spec.rb