Sha256: aaa0ae11a83ef133ee827f35578672b97b607266a886b981d4735e0ec933a291

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 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/lcm2'
require 'gooddata/lcm/actions/synchronize_etls_in_segment'

describe GoodData::LCM2::SynchronizeETLsInSegment do
  let(:gdc_gd_client) { double('gdc_gd_client') }
  let(:domain) { double('domain') }
  let(:segment) { double('segment') }

  context 'when sync processes/schedules has problem' do
    let(:result) do
      {
        syncedResult: {
          errors: [
            {
              errorId: "91a811a7-8d3a-42d2-a1ba-024933f74021",
              errorCode: "gdc.lcm.schedule.fatal_error",
              message: "Error",
              parameters: []
            }
          ]
        }
      }
    end

    let(:params) do
      params = {
        gdc_gd_client: gdc_gd_client,
        organization: domain,
        synchronize: [{ segment_id: 'some_segment_ids' }]

      }
      GoodData::LCM2.convert_to_smart_hash(params)
    end

    before do
      allow(gdc_gd_client).to receive(:domain) { domain }
      allow(domain).to receive(:segments) { segment }
      allow(segment).to receive(:synchronize_processes) { result }
    end

    it 'raise error' do
      expect { subject.class.call(params) }.to raise_error
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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