Sha256: 86659f74451a2dc5a289d76464533c5174b81496f117f5ade7036b01541c0c21

Contents?: true

Size: 1.32 KB

Versions: 10

Compression:

Stored size: 1.32 KB

Contents

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/test_project_model_spec.json"), :symbolize_keys => true)

    @source_project = @client.create_project_from_blueprint(spec, auth_token: ConnectionHelper::GD_PROJECT_TOKEN)
    @target_project = @client.create_project_from_blueprint(spec, auth_token: ConnectionHelper::GD_PROJECT_TOKEN)
  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

10 entries across 10 versions & 1 rubygems

Version Path
gooddata-0.6.18 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.17 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.16 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.15 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.14 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.13 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.12 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.11 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.10 spec/integration/partial_md_export_import_spec.rb
gooddata-0.6.9 spec/integration/partial_md_export_import_spec.rb