Sha256: 24517084eabb453e302492d8a8f0bf52facd007b5c493d5c9c1eb016f0c4233b

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

require 'spec_helper'

describe Direct::API::V5::Response::Error do
  let(:data) do
    {
      error_code: 54,
      error_string: 'No rights',
      error_detail: 'No rights to indicated client'
    }
  end

  subject { described_class.new(data) }

  describe '#code' do
    it { expect(subject.code).to eq(54) }
  end

  describe '#message' do
    it { expect(subject.message).to eq('No rights') }
  end

  describe '#details' do
    it { expect(subject.details).to eq('No rights to indicated client') }
  end

  describe '#to_h' do
    error_hash = { code: 54, message: 'No rights', details: 'No rights to indicated client' }
    it { expect(subject.to_h).to eq(error_hash) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
direct-api-v5-0.1.2 spec/direct/api/v5/response/error_spec.rb
direct-api-v5-0.1.1 spec/direct/api/v5/response/error_spec.rb
direct-api-v5-0.1.0 spec/direct/api/v5/response/error_spec.rb