Sha256: efef9b7f100492147894d5b5147e4e18555a86485c05d2c38e62db754f6926e9

Contents?: true

Size: 1.36 KB

Versions: 2

Compression:

Stored size: 1.36 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 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 'gooddata/connection'
require 'gooddata/core/project'
require 'gooddata/models/project'

describe 'GoodData - project', :vcr do
  before(:each) do
    @client = ConnectionHelper.create_default_connection
  end

  after(:each) do
    @client.disconnect
  end

  describe '#project=' do
    it 'Assigns nil' do
      GoodData.project = nil
    end

    it 'Assigns project using project ID' do
      GoodData.use(ProjectHelper::PROJECT_ID, client: @client)
    end

    it 'Assigns project using project URL' do
      GoodData.use ProjectHelper::PROJECT_URL, client: @client
    end

    it 'Assigns project directly' do
      GoodData.project = GoodData::Project[ProjectHelper::PROJECT_ID, client: @client]
    end
  end

  describe '#project' do
    it 'Returns project assigned' do
      GoodData.project = nil
      expect(GoodData.project).to be_nil

      GoodData.use ProjectHelper::PROJECT_ID, client: @client
      expect(GoodData.project).not_to be_nil
    end
  end

  describe '#with_project' do
    it 'Uses project specified' do
      GoodData.with_project GoodData::Project[ProjectHelper::PROJECT_ID, :client => @client] do
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gooddata-1.1.0-java spec/integration/core/project_spec.rb
gooddata-1.1.0 spec/integration/core/project_spec.rb