Sha256: 88c01de3413dd03cb423cbc172d6920d01eb8791c480bde600fa6e97038f6480

Contents?: true

Size: 1.28 KB

Versions: 28

Compression:

Stored size: 1.28 KB

Contents

require 'logger'

require 'helper'
require 'gooddata/command'

GoodData.logger = Logger.new(STDOUT)

class TestRestApiBasic < Test::Unit::TestCase
  context "GoodData REST Client" do
    # Initialize a GoodData connection using the credential
    # stored in ~/.gooddata
    setup do
      GoodData::Command::connect
    end

    should "get the demo project" do
      p_by_hash   = GoodData::Project[$DEMO_PROJECT]
      p_by_uri    = GoodData::Project["/gdc/projects/#{$DEMO_PROJECT}"]
      p_by_md_uri = GoodData::Project["/gdc/md/#{$DEMO_PROJECT}"]
      assert_not_nil p_by_hash
      assert_equal p_by_hash.uri, p_by_uri.uri
      assert_equal p_by_hash.title, p_by_uri.title
      assert_equal p_by_hash.title, p_by_md_uri.title
    end

    should "connect to the demo project" do
      GoodData.use $DEMO_PROJECT
      GoodData.project.datasets # should not fail on unknown project or access denied
                                # TODO: should be equal to Dataset.all once implemented
    end

    # Not supported yet
    # should "fetch dataset by numerical or string identifier" do
    #   GoodData.use $DEMO_PROJECT
    #   ds_by_hash = Dataset['amJoIYHjgESv']
    #   ds_by_id   = Dataset[34]
    #   assert_not_nil ds_by_hash
    #   assert_equal ds_by_hash.uri, ds_by_id.uri
    # end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
gooddata-0.6.0.pre11 test/test_rest_api_basic.rb
gooddata-0.6.0.pre10 test/test_rest_api_basic.rb
gooddata-0.6.0.pre9 test/test_rest_api_basic.rb
gooddata-0.6.0.pre8 test/test_rest_api_basic.rb
gooddata-0.6.0.pre7 test/test_rest_api_basic.rb
gooddata-0.6.0.pre6 test/test_rest_api_basic.rb
gooddata-0.6.0.pre5 test/test_rest_api_basic.rb
gooddata-0.6.0.pre4 test/test_rest_api_basic.rb
gooddata-0.6.0.pre3 test/test_rest_api_basic.rb
gooddata-0.6.0.pre2 test/test_rest_api_basic.rb
gooddata-0.5.16 test/test_rest_api_basic.rb
gooddata-0.5.15 test/test_rest_api_basic.rb
gooddata-0.5.14 test/test_rest_api_basic.rb
gooddata-0.5.13 test/test_rest_api_basic.rb
gooddata-0.5.12 test/test_rest_api_basic.rb
gooddata-0.5.11 test/test_rest_api_basic.rb
gooddata-0.5.10 test/test_rest_api_basic.rb
gooddata-0.5.9 test/test_rest_api_basic.rb
gooddata-0.5.8 test/test_rest_api_basic.rb
gooddata-0.5.7 test/test_rest_api_basic.rb