Sha256: 4c8bbc8aec5b78c6f80afa86c0a917ac77cd30e1055f7c2606ec871e5f53fe28

Contents?: true

Size: 1.98 KB

Versions: 3

Compression:

Stored size: 1.98 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::LCM, :constraint => 'slow' do
  before(:all) do
    @client = ConnectionHelper.create_default_connection

    spec = JSON.parse(File.read("./spec/data/blueprints/attribute_sort_order_blueprint.json"), :symbolize_names => true)
    blueprint = GoodData::Model::ProjectBlueprint.new(spec)

    @source_project = @client.create_project_from_blueprint(blueprint, token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
    @target_project = @client.create_project_from_blueprint(@source_project.blueprint, token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
  end

  after(:all) do
    @source_project && @source_project.delete
    @target_project && @target_project.delete
    @client && @client.disconnect
  end

  it 'should be able to transfer attribute drill paths' do
    name_attribute_source = @source_project.attributes('attr.id.name')
    id_attribute_source = @source_project.attributes('attr.id.id')
    name_attribute_source.drill_down(id_attribute_source)

    GoodData::LCM.transfer_attribute_drillpaths(@source_project, @target_project)

    name_attribute_target = @target_project.attributes('attr.id.name')
    id_attribute_target = @target_project.attributes('attr.id.id')
    name_attribute_target.drill_down(id_attribute_target)
    expect(@target_project.labels(name_attribute_target.content['drillDownStepAttributeDF']).attribute_uri).to eq id_attribute_target.meta['uri']
  end

  it 'should be able to transfer color palette' do
    @source_project.create_custom_color_palette([{ r: 155, g: 255, b: 0 }])
    GoodData::Project.transfer_color_palette(@source_project, @target_project)
    expect(@target_project.current_color_palette.colors).to eq [{ r: 155, g: 255, b: 0 }]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gooddata-0.6.53 spec/integration/lcm_spec.rb
gooddata-0.6.52 spec/integration/lcm_spec.rb
gooddata-0.6.51 spec/integration/lcm_spec.rb