Sha256: b7f19425b2d28b5a86db943562324a881e8de41d0773b0266e77e8a2e4fff69a

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Usps::Imis::Mapper do
  let(:api) { described_class.new.api }

  describe '#update' do
    before { api.imis_id = 31092 }

    it 'sends a mapped update' do
      expect(api.mapper.update(mm: 15).first).to be_a(Hash)
    end

    it 'raises for unmapped updates' do
      expect { api.mapper.update(something: 'anything') }.to raise_error(
        Usps::Imis::Error::Mapper,
        'Unrecognized field: "something". ' \
        'Please report what data you are attempting to work with to ITCom leadership.'
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
usps-imis-api-0.3.0 spec/lib/usps/imis/mapper_spec.rb