Sha256: e619dc23bf5a14cdca74de1783a703a47f520cdcd43c1e1b032be653608cc62e

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 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/collect_clients'
require 'gooddata/lcm/lcm2'

describe GoodData::LCM2::CollectClients do
  let(:data_source) { double(:data_source) }
  let(:input_data) { double(:input_data) }

  before do
    allow(GoodData::Helpers::DataSource).to receive(:new)
      .and_return(data_source)
    allow(data_source).to receive(:realize)
      .and_return('spec/data/workspace_table.csv')
  end

  context 'when segments is specified' do
    let(:params) do
      params = {
        segments: [{ segment_id: 'segment_foo' }],
        input_source: {}
      }
      GoodData::LCM2.convert_to_smart_hash(params)
    end

    it 'collects all clients' do
      result = subject.class.call(params)
      expected = [{ client: 'client_foo',
                    segment_id: 'segment_foo',
                    title: nil }]
      expect(result[:results]).to eq(expected)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gooddata-0.6.53 spec/unit/actions/collect_clients_spec.rb
gooddata-0.6.52 spec/unit/actions/collect_clients_spec.rb