Sha256: 40ee479a4e297163549f109550cc1c3894fecba4031619d625322174731282bc
Contents?: true
Size: 692 Bytes
Versions: 22
Compression:
Stored size: 692 Bytes
Contents
# frozen_string_literal: true describe SirTrevorRails::Blocks::SearchResultsBlock do subject { described_class.new({ type: '', data: block_data }, page) } let(:page) { FactoryBot.create(:feature_page) } let(:block_data) { {} } describe '#items' do it 'is the array of items with display set to true' do block_data[:item] = { '0': { id: 'abc123', display: 'true' }, '1': { id: 'xyz321', display: 'false' } } expect(subject.items.length).to eq 1 expect(subject.items).to eq([{ id: 'abc123', display: 'true' }]) end it 'is an empty array when there is no browse category' do expect(subject.items).to eq([]) end end end
Version data entries
22 entries across 22 versions & 1 rubygems