Sha256: 1aee4dc60cf2e7df74b08707ddbd165da3e8e692f8835c95266eb48d2fc6c323

Contents?: true

Size: 1.9 KB

Versions: 9

Compression:

Stored size: 1.9 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'

describe GoodData::AdsOutputStage, :constraint => 'slow' do
  before(:all) do
    @client = ConnectionHelper.create_default_connection
    @ads = GoodData::DataWarehouse.create(client: @client, title: 'Test ADS', auth_token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
    @project = @client.create_project(title: 'Test project', auth_token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
  end

  after(:all) do
    # We need to delete the output stage explicitly
    # because of https://jira.intgdc.com/browse/DSS-2967
    @project && @project.add && @project.add.output_stage && @project.add.output_stage.delete
    @project && @project.delete
    @ads && @ads.delete
    @client && @client.disconnect
  end

  it 'should be able to create output stage' do
    @project.add.output_stage = GoodData::AdsOutputStage.create(client: @client, ads: @ads, client_id: 'Client_Id', project: @project)
    expect(@project.add.output_stage.schema).to eq "#{@ads.schemas}/default"
    expect(@project.add.output_stage.client_id).to eq 'Client_Id'
    expect(@project.add.process).not_to be_nil
    expect(@project.add.process.type).to eq :dataload
  end

  it 'shoule be able to show the sql diff' do
    expect(@project.add.output_stage.sql_diff).to eq '-- Output Stage and LDM column mapping matches.'
  end

  describe '#delete' do
    it 'deletes the link to schema' do
      output_stage = GoodData::AdsOutputStage.create(client: @client, ads: @ads, client_id: 'Client_Id', project: @project)
      expect(output_stage.data['schema']).not_to be_empty
      output_stage.delete
      expect(output_stage.data['schema']).to be_nil
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gooddata-1.1.0-java spec/integration/ads_output_stage_spec.rb
gooddata-1.1.0 spec/integration/ads_output_stage_spec.rb
gooddata-1.0.2-java spec/integration/ads_output_stage_spec.rb
gooddata-1.0.2 spec/integration/ads_output_stage_spec.rb
gooddata-1.0.1 spec/integration/ads_output_stage_spec.rb
gooddata-1.0.1-java spec/integration/ads_output_stage_spec.rb
gooddata-1.0.0-java spec/integration/ads_output_stage_spec.rb
gooddata-1.0.0 spec/integration/ads_output_stage_spec.rb
gooddata-0.6.54 spec/integration/ads_output_stage_spec.rb