Sha256: 7b4f9c6e63c8fb88e8cd6b1a388f0cf2c32ded4159526ed53dc8ee8cd266a008

Contents?: true

Size: 1.62 KB

Versions: 29

Compression:

Stored size: 1.62 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 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 "Object export between projects", :constraint => 'slow' do
  before(:all) do
    @client = ConnectionHelper.create_default_connection

    spec = MultiJson.load(File.read("./spec/data/blueprints/test_project_model_spec.json"), :symbolize_keys => true)
    
    @source_project = @client.create_project_from_blueprint(spec, token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
    @target_project = @client.create_project_from_blueprint(spec, token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
  end

  after(:all) do
    @source_project.delete unless @source_project.nil?
    @target_project.delete unless @target_project.nil?

    @client.disconnect
  end

  it "should transfer a metric" do
    f = GoodData::Fact.find_first_by_title('Lines Changed', :client => @client, :project => @source_project)
    metric_title = "Testing metric to be exported"
    metric = @source_project.create_metric("SELECT SUM(#\"#{f.title}\")", :title => metric_title)
    metric.save

    @target_project.metrics.count.should == 0

    @source_project.partial_md_export(metric, :project => @target_project)

    expect(@target_project.metrics.count).to eq 1
    metric = GoodData::Metric.find_first_by_title(metric_title, :client => @client, :project => @target_project)
    expect(metric).not_to be_nil
    expect(metric.title).to eq metric_title
  end

end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
gooddata-edge-0.6.27.edge spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.49 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.48 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.47 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.46 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.45 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.44 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.43 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.42 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.41 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.40 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.39 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.38 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.37 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.36 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.35 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.34 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.33 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.32 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.31 spec/integration/partial_md_export_import_spec.rb