Sha256: a7448c278fcd072b16dd2d90e5f503d801dd2972b5c6df45b9aaa357e6bb873f

Contents?: true

Size: 648 Bytes

Versions: 3

Compression:

Stored size: 648 Bytes

Contents

require 'gooddata/model'
require 'pry'

describe GoodData::Model::SchemaBuilder do

  it "should create a schema" do
    builder = GoodData::Model::SchemaBuilder.new("a_title")
    schema = builder.to_schema
    schema.title.should == "A title"
    schema.name.should == "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")

    schema = builder.to_schema
    schema.attributes.keys.count == 1
    schema.attributes["attr.payments.id"].title.should == "My Id"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gooddata-0.6.0.pre9 spec/model_dsl_spec.rb
gooddata-0.6.0.pre8 spec/model_dsl_spec.rb
gooddata-0.6.0.pre7 spec/model_dsl_spec.rb