Sha256: c9bbfc400dadad4cfd2e1f55b3c5a653a9f6fabbc285725b5654c246e80f55a6

Contents?: true

Size: 689 Bytes

Versions: 4

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'

RSpec.describe RockRMS::Response::ContentChannelType, type: :model do
  let(:parsed) { JSON.parse(FixturesHelper.read('content_channel_types.json')) }

  describe '.format' do
    subject(:result) { described_class.format(parsed) }

    context 'when response is array' do
      it 'returns an array' do
        expect(described_class.format([])).to be_a(Array)
      end
    end

    it 'has the correct number keys' do
      keys = result.first.keys
      expect(keys.count).to eq(9)
    end

    it 'translates keys' do
      result.zip(parsed) do |r, p|
        expect(r[:id]).to eq(p['Id'])
        expect(r[:name]).to eq(p['Name'])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rock_rms-9.13.0 spec/rock_rms/response/content_channel_type_spec.rb
rock_rms-9.12.0 spec/rock_rms/response/content_channel_type_spec.rb
rock_rms-9.11.0 spec/rock_rms/response/content_channel_type_spec.rb
rock_rms-9.10.0 spec/rock_rms/response/content_channel_type_spec.rb