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