Sha256: 99032aa6440227cf990b47bfeb3ef3e44777da460d96b79afafff8a1297a285f

Contents?: true

Size: 1.19 KB

Versions: 29

Compression:

Stored size: 1.19 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 'pry'
require 'gooddata/models/model'

describe GoodData::Model::SchemaBuilder do

  it "should create a schema" do
    builder = GoodData::Model::SchemaBuilder.new("a_title")
    blueprint = builder.to_blueprint
    expect(blueprint.datasets.first.title).to eq 'A Title'
  end

  it "should create a schema with some columns" do
    builder = GoodData::Model::SchemaBuilder.new("payments")
    builder.add_attribute("id", :title => "My Id")
    builder.add_fact("amount", :title => "Amount")

    blueprint = builder.to_blueprint
    blueprint.attributes.count == 1
  end

  it "should be able to create from block" do
    builder = GoodData::Model::SchemaBuilder.create("payments") do |d|
      d.add_attribute('attr.id', :title => 'Id')
      d.add_label('label.id.name', :title => 'Id Name', reference: 'attr.id')
      d.add_fact('amount', :title => 'Amount')
    end

    blueprint = builder.to_blueprint
    blueprint.attributes.count == 1
    blueprint.facts.count == 1
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

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