Sha256: 13f6b29e6a7df17d3031c2143c1a088d6650bba42bfe31d67e843834522b32ac

Contents?: true

Size: 938 Bytes

Versions: 1

Compression:

Stored size: 938 Bytes

Contents

#encoding: utf-8
require 'spec_helper'

describe Comfan do
  subject{Comfan}

  describe '.api_id' do
    it 'returns the same ID for API ID' do
      input = '752S00000000KtkIAE'
      expect(subject.api_id(input)).to eq(input)
    end

    it 'returns the correct API ID for UI ID' do
      input = '752S00000000Ktk'
      output = '752S00000000KtkIAE'
      expect(subject.api_id(input)).to eq(output)
    end

    it 'returns nil for nil input' do
      expect(subject.api_id(nil)).to be_nil
    end
  end

  describe '.ui_id' do
    it 'returns the same ID for UI ID' do
      input = '752S00000000Ktk'
      expect(subject.ui_id(input)).to eq(input)
    end

    it 'returns the correct UI ID for API ID' do
      input = '752S00000000KtkIAE'
      output = '752S00000000Ktk'
      expect(subject.ui_id(input)).to eq(output)
    end

    it 'returns nil for nil input' do
      expect(subject.ui_id(nil)).to be_nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comfan-0.1.1 spec/lib/comfan_spec.rb