Sha256: e21346bdeda7f75d0cf0cc8dce350555c2ba3bd68cd12063c11563b26e9ab777
Contents?: true
Size: 1.23 KB
Versions: 9
Compression:
Stored size: 1.23 KB
Contents
# encoding: UTF-8 # # Copyright (c) 2010-2017 GoodData Corporation. All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. require 'gooddata/lcm/actions/segments_filter' require 'gooddata/lcm/lcm2' describe GoodData::LCM2::SegmentsFilter do context 'when segments contains duplicate segment ids' do let(:params) do params = { segments: [ { segment_id: 'segment_foo' }, { segment_id: 'Segment_foo' } ] } GoodData::LCM2.convert_to_smart_hash(params) end it 'raise error' do expect { subject.class.call(params) }.to raise_error(/segment_foo/, /Segment_foo/) end end context 'when passed segments' do let(:params) do params = { segments: [ { segment_id: 'correct-segment' }, { segment_id: 'wrong-segment' } ], segments_filter: [ 'correct-segment' ] } GoodData::LCM2.convert_to_smart_hash(params) end it 'filters the segments according to segments_filter' do results = subject.class.call(params) expect(results[:results].first.segment_id).to eq 'correct-segment' end end end
Version data entries
9 entries across 9 versions & 1 rubygems