Sha256: 7d0b845f314902a99753cd43255bfdda66733c6c6d9ff47d649825a52bfd4ae0

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require 'gooddata'

describe GoodData::Model::ProjectBlueprint do

  before(:each) do
    @blueprint = GoodData::Model::ProjectBlueprint.from_json("./spec/data/test_project_model_spec.json")
    @repos = @blueprint.get_dataset("repos")
    @repos_schema = @repos.to_schema

    @commits = @blueprint.get_dataset("commits")
    @commits_schema = @commits.to_schema
  end

  it "should be able to grab attribute" do
    @repos_schema.labels.size.should == 1
    @repos_schema.labels.first.attribute.name.should == "id"
  end

  it "anchor should have labels" do
    @repos_schema.anchor.labels.first.identifier.should == "label.repos.id"
  end

  it "attribute should have labels" do
    @repos_schema.attributes.first.labels.first.identifier.should == "label.repos.department"
  end

  it "commits should have one fact" do
    @commits_schema.facts.size.should == 1
  end

  it "Anchor on repos should have a label" do
    @repos_schema.anchor.labels.size.should == 2
  end

  it "should not have a label for a dataset without anchor with label" do
    @commits.anchor.should == nil
    @commits.to_schema.anchor.labels.empty?.should == true 
  end

  it "should be able to provide wire representation" do
    @commits.to_wire_model
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gooddata-0.6.0 spec/unit/model/project_blueprint_spec.rb
gooddata-0.6.0.pre11 spec/unit/model/project_blueprint_spec.rb
gooddata-0.6.0.pre10 spec/model_spec.rb